Documentation ¶
Index ¶
Constants ¶
const ( // Path to the capnp schema that ship with Sandstorm, assuming sandstorm // is installed in /opt/sandstorm. SandstormCapnpPath = "/opt/sandstorm/latest/usr/include" )
Variables ¶
Functions ¶
func PackInto ¶
Write an .spk into `dest`, using `archive` as the contents and `key` for signing. The archive must already contain the manifest.
func ReadPackageDefinition ¶
func ReadPackageDefinition(file, variable string, extraPaths []string) (spk.PackageDefinition, error)
Read the package definition from a textual pkgdef on disk. The `capnp` executable must be in PATH.
Parameters:
- file: The schema file to read - variable: the name of the variable in the file defining the package definition. - extraPaths: a list of extra directories to search for capnproto schema.
A typical use of this would be:
ReadPackageDefinition("sandstorm-pkgdef.capnp", "pkgdef", []string{SandstormCapnpPath})
Types ¶
type Key ¶
A package signing key
func GenerateKey ¶
Generate a new signing key. It will be the root object of its own message. The argument is a cryptographic random number generator. Defaults to crypto/rand.Reader if nil.
func (Key) AddToFile ¶
Add the key to the keyring in the file at `path`, which is created if it does not already exist.
type Keyring ¶
type Keyring struct {
// contains filtered or unexported fields
}
The contents of a sandstorm keyring, typically stored at ~/.sandstorm-keyring or ~/.sandstorm/sandstorm-keyring.
func LoadKeyring ¶
Load the sandstorm keyring from a named file.
type PkgDefParams ¶
type PkgDefParams struct { AppId AppId Key Key // The capnp schema id for the app's sandstorm-pkgdef.capnp SchemaId uint64 // The keyring in which to save the gerated key. // Defaults to ~/.sandstorm/sandstorm-keyring KeyringPath string // Path to save the package definition. Defaults to // `.sandstorm/sandstorm-pkgdef.capnp`. PkgDefPath string }
Parameters for initializing an application's pkgdef.
func NewApp ¶
func NewApp() (*PkgDefParams, error)
Generate the information needed to initialize a new app.
func (*PkgDefParams) Emit ¶
func (p *PkgDefParams) Emit() error
Emit a pkgdef with the given parameters, and save the app's key to the keyring.