put a fragement of an aircraft schema into the test.capnp file, to provide for tested struct and union testing

using Go = import "go.capnp";

$Go.package("capn_test");
$Go.import("capn_test");

@0x832bcc6686a26d56;

struct Zdate {
  year  @0   :Int16;
  month @1   :UInt8;
  day   @2   :UInt8;
}

struct Zdata {
  data @0 :Data;
}

enum Airport {
  none @0;
  jfk @1;
  lax @2;
  sfo @3;
  luv @4;
  dfw @5;
  test @6;
  # test loc must be last because we use it to count
  # the number of elements in the Airport enum!!
}

struct PlaneBase {
  name       @0: Text;
  homes      @1: List(Airport);
  rating     @2: Int64;
  canFly     @3: Bool;
  capacity   @4: Int64;
  maxSpeed   @5: Float64;
}

struct B737 {
  base @0: PlaneBase;
}

struct A320 {
  base @0: PlaneBase;
}

struct F16 {
  base @0: PlaneBase;
}

# need a struct with at least two pointers to catch certain bugs
struct Regression {
  base     @0: PlaneBase;
  b0       @1: Float64; # intercept
  beta     @2: List(Float64);
  planes   @3: List(Aircraft);
  ymu      @4: Float64; # y-mean in original space
  ysd      @5: Float64; # y-standard deviation in original space
}

struct Aircraft {
  #  so we can restrict
  #  and specify a Plane is required in
  #  certain places.

  union {
    void      @0: Void; # @0 will be the default, so always make @0 a Void.
    b737      @1: B737;
    a320      @2: A320;
    f16       @3: F16;
  }
}

struct Z {
  # Z must contain all types, as this is our
  # runtime type identification. It is a thin shim.

  union {
    void              @0: Void; # always first in any union.
    zz                @1: Z;    # any. fyi, this can't be 'z' alone.

    f64               @2: Float64;
    f32               @3: Float32;

    i64               @4: Int64;
    i32               @5: Int32;
    i16               @6: Int16;
    i8                @7: Int8;

    u64               @8:  UInt64;
    u32               @9:  UInt32;
    u16               @10: UInt16;
    u8                @11: UInt8;

    bool              @12: Bool;
    text              @13: Text;
    blob              @14: Data;

    f64vec            @15: List(Float64);
    f32vec            @16: List(Float32);

    i64vec            @17: List(Int64);
    i32vec            @18: List(Int32);
    i16vec            @19: List(Int16);
    i8vec             @20: List(Int8);

    u64vec            @21: List(UInt64);
    u32vec            @22: List(UInt32);
    u16vec            @23: List(UInt16);
    u8vec             @24: List(UInt8);

    zvec              @25: List(Z);
    zvecvec           @26: List(List(Z));

    zdate             @27: Zdate;
    zdata             @28: Zdata;

    aircraftvec       @29: List(Aircraft);
    aircraft          @30: Aircraft;
    regression        @31: Regression;
    planebase         @32: PlaneBase;
  }
}

using Go = import "go.capnp";

$Go.package("capn_test");

@0x832bcc6686a26d56;

struct Zdate {
  year  @0   :Int16;
  month @1   :UInt8;
  day   @2   :UInt8;
}

struct Zdata {
  data @0 :Data;
}


fixed categories keywords

fixed categories keywords

@0xbbbe049af795122e;

using Spk = import "/sandstorm/package.capnp";
# This imports:
#   $SANDSTORM_HOME/latest/usr/include/sandstorm/package.capnp
# Check out that file to see the full, documented package definition format.

const pkgdef :Spk.PackageDefinition = (
  # The package definition. Note that the spk tool looks specifically for the
  # "pkgdef" constant.

  id = "vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0",
  # Your app ID is actually its public key. The private key was placed in
  # your keyring. All updates must be signed with the same key.

  manifest = (
    # This manifest is included in your app package to tell Sandstorm
    # about your app.

    appTitle = (defaultText = "Rocket.Chat"),

    appVersion = 4,  # Increment this for every release.

    appMarketingVersion = (defaultText = "0.8.1"),
    # Human-readable representation of appVersion. Should match the way you
    # identify versions of your app in documentation and marketing.

    actions = [
      # Define your "new document" handlers here.
      ( title = (defaultText = "New Rocket.Chat"),
        command = .myCommand
        # The command to run when starting for the first time. (".myCommand"
        # is just a constant defined at the bottom of the file.)
      )
    ],

    continueCommand = .myCommand,
    # This is the command called to start your app back up after it has been
    # shut down for inactivity. Here we're using the same command as for
    # starting a new instance, but you could use different commands for each
    # case.

    metadata = (
      icons = (
        appGrid = (svg = embed "rocket.chat-128.svg"),
        grain = (svg = embed "rocket.chat-24.svg"),
        market = (svg = embed "rocket.chat-150.svg"),
      ),

      website = "https://rocket.chat",
      codeUrl = "https://github.com/RocketChat/Rocket.Chat",
      license = (openSource = mit),
      categories = [communications, productivity, office, social, devTools],

      author = (
        contactEmail = "team@rocket.chat",
        pgpSignature = embed "pgp-signature",
        upstreamAuthor = "Rocket.Chat",
      ),
      pgpKeyring = embed "pgp-keyring",

      description = (defaultText = embed "description.md"),
      shortDescription = (defaultText = "Chat app"),

      screenshots = [
        (width = 1203, height = 760, png = embed "screenshot.png")
      ],

      changeLog = (defaultText = embed "CHANGELOG.md"),
    ),

  ),

  sourceMap = (
    # The following directories will be copied into your package.
    searchPath = [
      ( sourcePath = "/home/vagrant/bundle" ),
      ( sourcePath = "/opt/meteor-spk/meteor-spk.deps" )
    ]
  ),

  alwaysInclude = [ "." ]
  # This says that we always want to include all files from the source map.
  # (An alternative is to automatically detect dependencies by watching what
  # the app opens while running in dev mode. To see what that looks like,
  # run `spk init` without the -A option.)
);

const myCommand :Spk.Manifest.Command = (
  # Here we define the command used to start up your server.
  argv = ["/sandstorm-http-bridge", "8000", "--", "/opt/app/.sandstorm/launcher.sh"],
  environ = [
    # Note that this defines the *entire* environment seen by your app.
    (key = "PATH", value = "/usr/local/bin:/usr/bin:/bin"),
    (key = "SANDSTORM", value = "1")
  ]
);

@0xbbbe049af795122e;

using Spk = import "/sandstorm/package.capnp";
# This imports:
#   $SANDSTORM_HOME/latest/usr/include/sandstorm/package.capnp
# Check out that file to see the full, documented package definition format.

const pkgdef :Spk.PackageDefinition = (
  # The package definition. Note that the spk tool looks specifically for the
  # "pkgdef" constant.

  id = "vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0",
  # Your app ID is actually its public key. The private key was placed in
  # your keyring. All updates must be signed with the same key.

  manifest = (
    # This manifest is included in your app package to tell Sandstorm
    # about your app.

    appTitle = (defaultText = "Rocket.Chat"),

    appVersion = 4,  # Increment this for every release.

    appMarketingVersion = (defaultText = "0.8.1"),
    # Human-readable representation of appVersion. Should match the way you
    # identify versions of your app in documentation and marketing.

    actions = [
      # Define your "new document" handlers here.
      ( title = (defaultText = "New Rocket.Chat"),
        command = .myCommand
        # The command to run when starting for the first time. (".myCommand"
        # is just a constant defined at the bottom of the file.)
      )
    ],

    continueCommand = .myCommand,
    # This is the command called to start your app back up after it has been
    # shut down for inactivity. Here we're using the same command as for
    # starting a new instance, but you could use different commands for each
    # case.

    metadata = (
      icons = (
        appGrid = (svg = embed "rocket.chat-128.svg"),
        grain = (svg = embed "rocket.chat-24.svg"),
        market = (svg = embed "rocket.chat-150.svg"),
      ),

      website = "https://rocket.chat",
      codeUrl = "https://github.com/RocketChat/Rocket.Chat",
      license = (openSource = mit),
      categories = [communications, productivity, office, devtools, social],

      author = (
        contactEmail = "team@rocket.chat",
        pgpSignature = embed "pgp-signature",
        upstreamAuthor = "Rocket.Chat",
      ),
      pgpKeyring = embed "pgp-keyring",

      description = (defaultText = embed "description.md"),
      shortDescription = (defaultText = "Chat app"),

      screenshots = [
        (width = 1203, height = 760, png = embed "screenshot.png")
      ],

      changeLog = (defaultText = embed "CHANGELOG.md"),
    ),

  ),

  sourceMap = (
    # The following directories will be copied into your package.
    searchPath = [
      ( sourcePath = "/home/vagrant/bundle" ),
      ( sourcePath = "/opt/meteor-spk/meteor-spk.deps" )
    ]
  ),

  alwaysInclude = [ "." ]
  # This says that we always want to include all files from the source map.
  # (An alternative is to automatically detect dependencies by watching what
  # the app opens while running in dev mode. To see what that looks like,
  # run `spk init` without the -A option.)
);

const myCommand :Spk.Manifest.Command = (
  # Here we define the command used to start up your server.
  argv = ["/sandstorm-http-bridge", "8000", "--", "/opt/app/.sandstorm/launcher.sh"],
  environ = [
    # Note that this defines the *entire* environment seen by your app.
    (key = "PATH", value = "/usr/local/bin:/usr/bin:/bin"),
    (key = "SANDSTORM", value = "1")
  ]
);


Add shortDescription

Add shortDescription

So that we can link to the Etherpad manifest as an example without the caveat that it's missing a thing.

@0x93020f652e8a8459;

using Spk = import "/sandstorm/package.capnp";
# This imports:
#   $SANDSTORM_HOME/latest/usr/include/sandstorm/package.capnp
# Check out that file to see the full, documented package definition format.

const pkgdef :Spk.PackageDefinition = (
  # The package definition. Note that the spk tool looks specifically for the
  # "pkgdef" constant.

  id = "h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60",
  # Your app ID is actually its public key. The private key was placed in
  # your keyring. All updates must be signed with the same key.

  manifest = (
    # This manifest is included in your app package to tell Sandstorm
    # about your app.

    appTitle = (defaultText = "Etherpad"),

    appVersion = 11,  # Increment this for every release.

    appMarketingVersion = (defaultText = "1.5.7"),

    actions = [
      # Define your "new document" handlers here.
      ( title = (defaultText = "New Etherpad Document"),
        nounPhrase = (defaultText = "pad"),
        command = .myCommand
        # The command to run when starting for the first time. (".myCommand"
        # is just a constant defined at the bottom of the file.)
      )
    ],

    continueCommand = .myCommand,
    # This is the command called to start your app back up after it has been
    # shut down for inactivity. Here we're using the same command as for
    # starting a new instance, but you could use different commands for each
    # case.

    metadata = (
      icons = (
        appGrid = (svg = embed "app-graphics/etherpad-128.svg"),
        grain = (svg = embed "app-graphics/etherpad-24.svg"),
        market = (svg = embed "app-graphics/etherpad-150.svg"),
      ),

      website = "http://etherpad.org/",
      codeUrl = "https://github.com/kentonv/etherpad-lite",
      license = (openSource = apache2),
      categories = [office, productivity],

      author = (
        contactEmail = "kenton@sandstorm.io",
        pgpSignature = embed "pgp-signature",
        upstreamAuthor = "Etherpad Foundation",
      ),
      pgpKeyring = embed "pgp-keyring",

      description = (defaultText = embed "description.md"),
      shortDescription = (defaultText = "Document editor"),

      screenshots = [
        (width = 448, height = 343, png = embed "sandstorm-screenshot.png")
      ],

      changeLog = (defaultText = embed "CHANGELOG.md"),
    ),
  ),

  sourceMap = (
    # Here we defined where to look for files to copy into your package. The
    # `spk dev` command actually figures out what files your app needs
    # automatically by running it on a FUSE filesystem. So, the mappings
    # here are only to tell it where to find files that the app wants.
    searchPath = [
      ( sourcePath = "." ),  # Search this directory first.
      ( sourcePath = "/",    # Then search the system root directory.
        hidePaths = [ "home", "proc", "sys" ]
        # You probably don't want the app pulling files from these places,
        # so we hide them. Note that /dev, /var, and /tmp are implicitly
        # hidden because Sandstorm itself provides them.
      )
    ]
  ),

  fileList = "sandstorm-files.list",
  # `spk dev` will write a list of all the files your app uses to this file.
  # You should review it later, before shipping your app.

  alwaysInclude = ["src"],
  # Fill this list with more names of files or directories that should be
  # included in your package, even if not listed in sandstorm-files.list.
  # Use this to force-include stuff that you know you need but which may
  # not have been detected as a dependency during `spk dev`. If you list
  # a directory here, its entire contents will be included recursively.

  bridgeConfig = (
    viewInfo = (
      permissions = [(name = "modify", title = (defaultText = "modify"),
                      description = (defaultText = "allows modifying the document")),
                     (name = "comment", title = (defaultText = "comment"),
                      description = (defaultText = "allows adding comments"))],
      roles = [(title = (defaultText = "editor"),
                permissions = [true, true],
                verbPhrase = (defaultText = "can edit"),
                default = true),
               (title = (defaultText = "viewer"),
                permissions = [false, false],
                verbPhrase = (defaultText = "can view")),
               (title = (defaultText = "commenter"),
                permissions = [false, true],
                verbPhrase = (defaultText = "can comment"))]
    )
  )
);

const myCommand :Spk.Manifest.Command = (
  # Here we define the command used to start up your server.
  argv = ["/sandstorm-http-bridge", "9001", "--", "bin/run.sh"],
  environ = [
    # Note that this defines the *entire* environment seen by your app.
    (key = "PATH", value = "/usr/local/bin:/usr/bin:/bin")
  ]
);

@0x93020f652e8a8459;

using Spk = import "/sandstorm/package.capnp";
# This imports:
#   $SANDSTORM_HOME/latest/usr/include/sandstorm/package.capnp
# Check out that file to see the full, documented package definition format.

const pkgdef :Spk.PackageDefinition = (
  # The package definition. Note that the spk tool looks specifically for the
  # "pkgdef" constant.

  id = "h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60",
  # Your app ID is actually its public key. The private key was placed in
  # your keyring. All updates must be signed with the same key.

  manifest = (
    # This manifest is included in your app package to tell Sandstorm
    # about your app.

    appTitle = (defaultText = "Etherpad"),

    appVersion = 11,  # Increment this for every release.

    appMarketingVersion = (defaultText = "1.5.7"),

    actions = [
      # Define your "new document" handlers here.
      ( title = (defaultText = "New Etherpad Document"),
        nounPhrase = (defaultText = "pad"),
        command = .myCommand
        # The command to run when starting for the first time. (".myCommand"
        # is just a constant defined at the bottom of the file.)
      )
    ],

    continueCommand = .myCommand,
    # This is the command called to start your app back up after it has been
    # shut down for inactivity. Here we're using the same command as for
    # starting a new instance, but you could use different commands for each
    # case.

    metadata = (
      icons = (
        appGrid = (svg = embed "app-graphics/etherpad-128.svg"),
        grain = (svg = embed "app-graphics/etherpad-24.svg"),
        market = (svg = embed "app-graphics/etherpad-150.svg"),
      ),

      website = "http://etherpad.org/",
      codeUrl = "https://github.com/kentonv/etherpad-lite",
      license = (openSource = apache2),
      categories = [office, productivity],

      author = (
        contactEmail = "kenton@sandstorm.io",
        pgpSignature = embed "pgp-signature",
        upstreamAuthor = "Etherpad Foundation",
      ),
      pgpKeyring = embed "pgp-keyring",

      description = (defaultText = embed "description.md"),

      screenshots = [
        (width = 448, height = 343, png = embed "sandstorm-screenshot.png")
      ],

      changeLog = (defaultText = embed "CHANGELOG.md"),
    ),
  ),

  sourceMap = (
    # Here we defined where to look for files to copy into your package. The
    # `spk dev` command actually figures out what files your app needs
    # automatically by running it on a FUSE filesystem. So, the mappings
    # here are only to tell it where to find files that the app wants.
    searchPath = [
      ( sourcePath = "." ),  # Search this directory first.
      ( sourcePath = "/",    # Then search the system root directory.
        hidePaths = [ "home", "proc", "sys" ]
        # You probably don't want the app pulling files from these places,
        # so we hide them. Note that /dev, /var, and /tmp are implicitly
        # hidden because Sandstorm itself provides them.
      )
    ]
  ),

  fileList = "sandstorm-files.list",
  # `spk dev` will write a list of all the files your app uses to this file.
  # You should review it later, before shipping your app.

  alwaysInclude = ["src"],
  # Fill this list with more names of files or directories that should be
  # included in your package, even if not listed in sandstorm-files.list.
  # Use this to force-include stuff that you know you need but which may
  # not have been detected as a dependency during `spk dev`. If you list
  # a directory here, its entire contents will be included recursively.

  bridgeConfig = (
    viewInfo = (
      permissions = [(name = "modify", title = (defaultText = "modify"),
                      description = (defaultText = "allows modifying the document")),
                     (name = "comment", title = (defaultText = "comment"),
                      description = (defaultText = "allows adding comments"))],
      roles = [(title = (defaultText = "editor"),
                permissions = [true, true],
                verbPhrase = (defaultText = "can edit"),
                default = true),
               (title = (defaultText = "viewer"),
                permissions = [false, false],
                verbPhrase = (defaultText = "can view")),
               (title = (defaultText = "commenter"),
                permissions = [false, true],
                verbPhrase = (defaultText = "can comment"))]
    )
  )
);

const myCommand :Spk.Manifest.Command = (
  # Here we define the command used to start up your server.
  argv = ["/sandstorm-http-bridge", "9001", "--", "bin/run.sh"],
  environ = [
    # Note that this defines the *entire* environment seen by your app.
    (key = "PATH", value = "/usr/local/bin:/usr/bin:/bin")
  ]
);