pack

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	Sentrie *semver.Constraints `toml:"sentrie" json:"sentrie"`
}

func (*Engine) MarshalJSON

func (e *Engine) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler for Engine to serialize semver.Constraints as string this is necessary because semver.Constraints does not implement json.Marshaler

func (*Engine) UnmarshalJSON

func (e *Engine) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler for Engine to deserialize semver.Constraints from string

type Pack

type Pack struct {
	Pack     *PackFile
	Programs []*ast.Program
}

type PackFile

type PackFile struct {
	SchemaVersion *SentrieSchema   `toml:"schema" json:"schema"`
	Pack          *PackInformation `toml:"pack" json:"pack"`
	Permissions   *Permissions     `toml:"permissions,omitempty" json:"permissions"`
	Engine        *Engine          `toml:"engine,omitempty" json:"engine"`
	Metadata      map[string]any   `toml:"metadata,omitempty" json:"metadata"`
	Location      string           `toml:"-" json:"-"`
}

func NewPackFile

func NewPackFile(name string) *PackFile

type PackInformation

type PackInformation struct {
	Name        string            `toml:"name" json:"name"`
	Version     *semver.Version   `toml:"version" json:"version"`
	Description string            `toml:"description,omitempty" json:"description"`
	License     string            `toml:"license,omitempty" json:"license"`
	Repository  string            `toml:"repository,omitempty" json:"repository"`
	Authors     map[string]string `toml:"authors,omitempty" json:"authors"`
}

type Permissions

type Permissions struct {
	FSRead []string `toml:"fs_read,omitempty" json:"fs_read"`
	Net    []string `toml:"net,omitempty" json:"net"`
	Env    []string `toml:"env,omitempty" json:"env"`
}

func (*Permissions) CheckEnvAccess

func (p *Permissions) CheckEnvAccess(name string) bool

type SentrieSchema

type SentrieSchema struct {
	Version uint64 `toml:"version" json:"version"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL