Documentation
¶
Index ¶
- Constants
- Variables
- func BindConst(a, b Value) error
- func Cache(ctx context.Context, cachePath string, rd Readable) (string, error)
- func DecodeProto(ctx context.Context, name Symbol, sink PipeSink, r io.Reader) error
- func Details(val Value) string
- func Dump(dst io.Writer, val any)
- func Each(list List, cb func(Value) error) error
- func EachBindingList(binding List, cb func(Symbol, Range) error) error
- func EncodeList(list List, enc zapcore.ArrayEncoder) error
- func ForkTrace(ctx context.Context) context.Context
- func IsApplicative(val Value) bool
- func IsList(val Value) bool
- func IsOperative(val Value) bool
- func IsPathLike(arg string) bool
- func Logger() *zap.Logger
- func LoggerTo(w io.Writer) *zap.Logger
- func MarshalJSON(val any) ([]byte, error)
- func MarshalProto(val Value) (*proto.Value, error)
- func NewEncoder(w io.Writer) *json.Encoder
- func NewError(msg string, kv ...Value) error
- func NewRawDecoder(r io.Reader) *json.Decoder
- func PrintBindingDocs(ctx context.Context, scope *Scope, form, val Value)
- func RunMain(ctx context.Context, scope *Scope, args ...Value) error
- func UnmarshalJSON(payload []byte, dest any) error
- func WithRuntimePool(ctx context.Context, pool RuntimePool) context.Context
- func WithTrace(ctx context.Context, trace *Trace) context.Context
- type Annotate
- type AnnotateBinding
- type Annotated
- type Applicative
- type ArityError
- type Bind
- func (bind Bind) Bind(ctx context.Context, bindScope *Scope, cont Cont, val Value, _ ...Annotated) ReadyCont
- func (value Bind) Decode(dest any) error
- func (bind Bind) EachBinding(cb func(Symbol, Range) error) error
- func (value Bind) Equal(ovalue Value) bool
- func (value Bind) Eval(ctx context.Context, scope *Scope, cont Cont) ReadyCont
- func (value Bind) MarshalJSON() ([]byte, error)
- func (value Bind) String() string
- type BindMismatchError
- type Bindable
- type Bindings
- type Bool
- func (binding Bool) Bind(_ context.Context, _ *Scope, cont Cont, val Value, _ ...Annotated) ReadyCont
- func (value Bool) Decode(dest any) error
- func (Bool) EachBinding(func(Symbol, Range) error) error
- func (value Bool) Equal(other Value) bool
- func (value Bool) Eval(_ context.Context, _ *Scope, cont Cont) ReadyCont
- func (value Bool) MarshalProto() (proto.Message, error)
- func (value Bool) String() string
- type Builtin
- func (builtin Builtin) Call(ctx context.Context, val Value, scope *Scope, cont Cont) ReadyCont
- func (value *Builtin) Decode(dest any) error
- func (value *Builtin) Equal(other Value) bool
- func (value *Builtin) Eval(_ context.Context, _ *Scope, cont Cont) ReadyCont
- func (value *Builtin) MarshalJSON() ([]byte, error)
- func (value *Builtin) String() string
- type CannotBindError
- type Combiner
- type CommandPath
- func (binding CommandPath) Bind(_ context.Context, _ *Scope, cont Cont, val Value, _ ...Annotated) ReadyCont
- func (combiner CommandPath) Call(ctx context.Context, val Value, scope *Scope, cont Cont) ReadyCont
- func (value CommandPath) Decode(dest any) error
- func (CommandPath) EachBinding(func(Symbol, Range) error) error
- func (value CommandPath) Equal(other Value) bool
- func (value CommandPath) Eval(_ context.Context, _ *Scope, cont Cont) ReadyCont
- func (path CommandPath) Extend(ext Path) (Path, error)
- func (value CommandPath) MarshalProto() (proto.Message, error)
- func (value CommandPath) Name() string
- func (value CommandPath) String() string
- func (path *CommandPath) UnmarshalProto(msg proto.Message) error
- func (app CommandPath) Unwrap() Combiner
- type CompleteOpt
- type CompleteOpts
- type Config
- type Cons
- func (binding Cons) Bind(ctx context.Context, scope *Scope, cont Cont, value Value, _ ...Annotated) ReadyCont
- func (value Cons) Decode(dest any) error
- func (binding Cons) EachBinding(cb func(Symbol, Range) error) error
- func (value Cons) Equal(other Value) bool
- func (value Cons) Eval(ctx context.Context, scope *Scope, cont Cont) ReadyCont
- func (value Cons) First() Value
- func (value Cons) MarshalJSON() ([]byte, error)
- func (cons Cons) MarshalLogArray(enc zapcore.ArrayEncoder) error
- func (value Cons) Rest() Value
- func (value Cons) String() string
- type Cont
- type Continuation
- func (cont *Continuation) Call(res Value, err error) ReadyCont
- func (value *Continuation) Decode(dest any) error
- func (value *Continuation) Equal(other Value) bool
- func (value *Continuation) Eval(_ context.Context, _ *Scope, cont Cont) ReadyCont
- func (value *Continuation) MarshalJSON() ([]byte, error)
- func (value *Continuation) String() string
- func (value *Continuation) Traced(trace *Trace) Cont
- type CrossSource
- type Decodable
- type DecodeError
- type Decoder
- type DirPath
- func (binding DirPath) Bind(_ context.Context, _ *Scope, cont Cont, val Value, _ ...Annotated) ReadyCont
- func (combiner DirPath) Call(ctx context.Context, val Value, scope *Scope, cont Cont) ReadyCont
- func (value DirPath) Decode(dest any) error
- func (value DirPath) Dir() DirPath
- func (DirPath) EachBinding(func(Symbol, Range) error) error
- func (value DirPath) Equal(other Value) bool
- func (value DirPath) Eval(_ context.Context, _ *Scope, cont Cont) ReadyCont
- func (dir DirPath) Extend(ext Path) (Path, error)
- func (value DirPath) FromSlash() string
- func (value DirPath) IsDir() bool
- func (value DirPath) MarshalProto() (proto.Message, error)
- func (value DirPath) Name() string
- func (value DirPath) Slash() string
- func (value DirPath) String() string
- func (path *DirPath) UnmarshalProto(msg proto.Message) error
- func (combiner DirPath) Unwrap() Combiner
- type Empty
- func (binding Empty) Bind(_ context.Context, _ *Scope, cont Cont, val Value, _ ...Annotated) ReadyCont
- func (value Empty) Decode(dest any) error
- func (Empty) EachBinding(func(Symbol, Range) error) error
- func (Empty) Equal(other Value) bool
- func (value Empty) Eval(_ context.Context, _ *Scope, cont Cont) ReadyCont
- func (Empty) First() Value
- func (Empty) MarshalJSON() ([]byte, error)
- func (Empty) MarshalLogArray(enc zapcore.ArrayEncoder) error
- func (Empty) MarshalProto() (proto.Message, error)
- func (Empty) Rest() Value
- func (Empty) String() string
- func (*Empty) UnmarshalJSON(payload []byte) error
- type Encodable
- type EncodeError
- type ExtendError
- type ExtendOperative
- func (op ExtendOperative) Call(_ context.Context, val Value, _ *Scope, cont Cont) ReadyCont
- func (value ExtendOperative) Decode(dest any) error
- func (value ExtendOperative) Equal(other Value) bool
- func (value ExtendOperative) Eval(_ context.Context, _ *Scope, cont Cont) ReadyCont
- func (value ExtendOperative) String() string
- type ExtendPath
- func (binding ExtendPath) Bind(ctx context.Context, scope *Scope, cont Cont, val Value, _ ...Annotated) ReadyCont
- func (value ExtendPath) Decode(dest any) error
- func (ExtendPath) EachBinding(func(Symbol, Range) error) error
- func (value ExtendPath) Equal(other Value) bool
- func (value ExtendPath) Eval(ctx context.Context, scope *Scope, cont Cont) ReadyCont
- func (value ExtendPath) String() string
- type FSPath
- func (fsp *FSPath) CachePath(ctx context.Context, dest string) (string, error)
- func (combiner *FSPath) Call(ctx context.Context, val Value, scope *Scope, cont Cont) ReadyCont
- func (value *FSPath) Decode(dest any) error
- func (value *FSPath) Dir() *FSPath
- func (value *FSPath) Equal(other Value) bool
- func (value *FSPath) Eval(_ context.Context, _ *Scope, cont Cont) ReadyCont
- func (path *FSPath) Extend(ext Path) (Path, error)
- func (value *FSPath) MarshalProto() (proto.Message, error)
- func (path *FSPath) Name() string
- func (fsp *FSPath) Open(ctx context.Context) (io.ReadCloser, error)
- func (value *FSPath) SHA256() (string, error)
- func (value *FSPath) String() string
- func (value *FSPath) UnmarshalProto(msg proto.Message) error
- func (app *FSPath) Unwrap() Combiner
- type FileOrDirPath
- func (path FileOrDirPath) Extend(ext Path) (FileOrDirPath, error)
- func (path FileOrDirPath) FilesystemPath() FilesystemPath
- func (path *FileOrDirPath) FromValue(val Value) error
- func (value FileOrDirPath) MarshalJSON() ([]byte, error)
- func (fod FileOrDirPath) MarshalProto() (proto.Message, error)
- func (path FileOrDirPath) Slash() string
- func (path FileOrDirPath) ToValue() Value
- func (value *FileOrDirPath) UnmarshalJSON(b []byte) error
- func (path *FileOrDirPath) UnmarshalProto(msg proto.Message) error
- type FilePath
- func (binding FilePath) Bind(_ context.Context, _ *Scope, cont Cont, val Value, _ ...Annotated) ReadyCont
- func (combiner FilePath) Call(ctx context.Context, val Value, scope *Scope, cont Cont) ReadyCont
- func (value FilePath) Decode(dest any) error
- func (value FilePath) Dir() DirPath
- func (FilePath) EachBinding(func(Symbol, Range) error) error
- func (value FilePath) Equal(other Value) bool
- func (value FilePath) Eval(_ context.Context, _ *Scope, cont Cont) ReadyCont
- func (path_ FilePath) Extend(ext Path) (Path, error)
- func (app FilePath) FileOrDir() FileOrDirPath
- func (value FilePath) FromSlash() string
- func (value FilePath) IsDir() bool
- func (value FilePath) MarshalProto() (proto.Message, error)
- func (value FilePath) Name() string
- func (value FilePath) Slash() string
- func (value FilePath) String() string
- func (path *FilePath) UnmarshalProto(msg proto.Message) error
- func (app FilePath) Unwrap() Combiner
- type FilesystemPath
- type FlagError
- type FormAnalyzer
- type HostPath
- func (path HostPath) CachePath(_ctx context.Context, _dest string) (string, error)
- func (combiner HostPath) Call(ctx context.Context, val Value, scope *Scope, cont Cont) ReadyCont
- func (value HostPath) Decode(dest any) error
- func (value HostPath) Equal(other Value) bool
- func (value HostPath) Eval(_ context.Context, _ *Scope, cont Cont) ReadyCont
- func (path HostPath) Extend(ext Path) (Path, error)
- func (hp HostPath) FromSlash() string
- func (value HostPath) MarshalProto() (proto.Message, error)
- func (path HostPath) Name() string
- func (path HostPath) Open(context.Context) (io.ReadCloser, error)
- func (value HostPath) String() string
- func (path *HostPath) UnmarshalProto(msg proto.Message) error
- func (app HostPath) Unwrap() Combiner
- type HostPathEscapeError
- type Ignore
- func (Ignore) Bind(_ context.Context, _ *Scope, cont Cont, _ Value, _ ...Annotated) ReadyCont
- func (value Ignore) Decode(dest any) error
- func (Ignore) EachBinding(func(Symbol, Range) error) error
- func (Ignore) Equal(other Value) bool
- func (value Ignore) Eval(_ context.Context, _ *Scope, cont Cont) ReadyCont
- func (Ignore) String() string
- type InMemorySink
- type InMemorySource
- type Int
- func (binding Int) Bind(_ context.Context, _ *Scope, cont Cont, val Value, _ ...Annotated) ReadyCont
- func (value Int) Decode(dest any) error
- func (Int) EachBinding(func(Symbol, Range) error) error
- func (value Int) Equal(other Value) bool
- func (value Int) Eval(_ context.Context, _ *Scope, cont Cont) ReadyCont
- func (value Int) MarshalProto() (proto.Message, error)
- func (value Int) String() string
- type JSONProtocol
- type JSONSink
- type JSONSource
- type Keyword
- func (binding Keyword) Bind(_ context.Context, _ *Scope, cont Cont, val Value, _ ...Annotated) ReadyCont
- func (value Keyword) Decode(dest any) error
- func (Keyword) EachBinding(func(Symbol, Range) error) error
- func (value Keyword) Equal(other Value) bool
- func (value Keyword) Eval(_ context.Context, _ *Scope, cont Cont) ReadyCont
- func (value Keyword) String() string
- func (value Keyword) Symbol() Symbol
- type List
- type Lockfile
- type Memos
- type NiceError
- type Null
- func (binding Null) Bind(_ context.Context, _ *Scope, cont Cont, val Value, _ ...Annotated) ReadyCont
- func (value Null) Decode(dest any) error
- func (Null) EachBinding(func(Symbol, Range) error) error
- func (Null) Equal(other Value) bool
- func (value Null) Eval(_ context.Context, _ *Scope, cont Cont) ReadyCont
- func (Null) MarshalJSON() ([]byte, error)
- func (value Null) MarshalProto() (proto.Message, error)
- func (Null) String() string
- type Operative
- func (combiner *Operative) Call(ctx context.Context, val Value, scope *Scope, cont Cont) ReadyCont
- func (value *Operative) Decode(dest any) error
- func (value *Operative) Equal(other Value) bool
- func (value *Operative) Eval(_ context.Context, _ *Scope, cont Cont) ReadyCont
- func (value *Operative) MarshalJSON() ([]byte, error)
- func (value *Operative) String() string
- type Pair
- func (binding Pair) Bind(ctx context.Context, scope *Scope, cont Cont, value Value, _ ...Annotated) ReadyCont
- func (value Pair) Decode(dest any) error
- func (binding Pair) EachBinding(cb func(Symbol, Range) error) error
- func (value Pair) Equal(other Value) bool
- func (value Pair) Eval(ctx context.Context, scope *Scope, cont Cont) ReadyCont
- func (value Pair) First() Value
- func (value Pair) MarshalJSON() ([]byte, error)
- func (pair Pair) MarshalLogArray(enc zapcore.ArrayEncoder) error
- func (value Pair) MarshalProto() (proto.Message, error)
- func (value Pair) Rest() Value
- func (value Pair) String() string
- func (value *Pair) UnmarshalJSON(payload []byte) error
- type Path
- type PipeSink
- type PipeSource
- type Platform
- type Position
- type ProtoMarshaler
- type ProtoUnmarshaler
- type Protocol
- type PruneOpts
- type Range
- type RawProtocol
- type ReadError
- type Readable
- type Reader
- type ReadonlyMemos
- type ReadyCont
- type ReadyContinuation
- func (value *ReadyContinuation) Decode(dest any) error
- func (value *ReadyContinuation) Equal(other Value) bool
- func (value *ReadyContinuation) Eval(_ context.Context, _ *Scope, cont Cont) ReadyCont
- func (cont *ReadyContinuation) Go() (Value, error)
- func (value *ReadyContinuation) MarshalJSON() ([]byte, error)
- func (cont *ReadyContinuation) String() string
- type RunState
- type Runs
- type Runtime
- type RuntimeAddrs
- type RuntimeConfig
- type RuntimePool
- type Scope
- func (scope *Scope) Complete(prefix string) []CompleteOpt
- func (value *Scope) Copy() *Scope
- func (value *Scope) Decode(dest any) error
- func (value *Scope) Each(f func(Symbol, Value) error) error
- func (value *Scope) Equal(o Value) bool
- func (value *Scope) Eval(_ context.Context, _ *Scope, cont Cont) ReadyCont
- func (scope *Scope) Get(binding Symbol) (Value, bool)
- func (scope *Scope) GetDecode(binding Symbol, dest any) error
- func (value *Scope) IsEmpty() bool
- func (value *Scope) IsSubsetOf(other *Scope) bool
- func (value *Scope) MarshalJSON() ([]byte, error)
- func (scope *Scope) MarshalLogObject(enc zapcore.ObjectEncoder) error
- func (value *Scope) MarshalProto() (proto.Message, error)
- func (scope *Scope) Set(binding Symbol, value Value, docs ...string)
- func (value *Scope) String() string
- func (value *Scope) UnmarshalJSON(payload []byte) error
- type Secret
- func (value Secret) Decode(dest any) error
- func (secret Secret) Equal(other Value) bool
- func (secret Secret) Eval(ctx context.Context, scope *Scope, cont Cont) ReadyCont
- func (value Secret) MarshalJSON() ([]byte, error)
- func (value Secret) MarshalProto() (proto.Message, error)
- func (secret Secret) Reveal() []byte
- func (secret Secret) String() string
- func (value *Secret) UnmarshalJSON(b []byte) error
- func (value *Secret) UnmarshalProto(msg proto.Message) error
- type Session
- type Sink
- type Source
- type String
- func (binding String) Bind(_ context.Context, _ *Scope, cont Cont, val Value, _ ...Annotated) ReadyCont
- func (value String) Decode(dest any) error
- func (String) EachBinding(func(Symbol, Range) error) error
- func (value String) Equal(other Value) bool
- func (value String) Eval(_ context.Context, _ *Scope, cont Cont) ReadyCont
- func (value String) MarshalProto() (proto.Message, error)
- func (value String) String() string
- type StructuredError
- type Symbol
- func (binding Symbol) Bind(ctx context.Context, scope *Scope, cont Cont, val Value, doc ...Annotated) ReadyCont
- func (combiner Symbol) Call(ctx context.Context, val Value, scope *Scope, cont Cont) ReadyCont
- func (value Symbol) Decode(dest any) error
- func (binding Symbol) EachBinding(cb func(Symbol, Range) error) error
- func (value Symbol) Equal(other Value) bool
- func (value Symbol) Eval(_ context.Context, scope *Scope, cont Cont) ReadyCont
- func (value Symbol) JSONKey() string
- func (value Symbol) Keyword() Keyword
- func (value Symbol) String() string
- func (app Symbol) Unwrap() Combiner
- type SymbolOperative
- func (op SymbolOperative) Call(_ context.Context, val Value, _ *Scope, cont Cont) ReadyCont
- func (value SymbolOperative) Decode(dest any) error
- func (value SymbolOperative) Equal(other Value) bool
- func (value SymbolOperative) Eval(_ context.Context, _ *Scope, cont Cont) ReadyCont
- func (value SymbolOperative) String() string
- type Thunk
- func (thunk Thunk) AppendArgs(args ...Value) Thunk
- func (wl Thunk) Avatar() (*invaders.Invader, error)
- func (thunk Thunk) CachePath(ctx context.Context, dest string) (string, error)
- func (combiner Thunk) Call(ctx context.Context, val Value, scope *Scope, cont Cont) ReadyCont
- func (thunk Thunk) Cmdline() string
- func (thunk Thunk) Decode(dest any) error
- func (thunk Thunk) Equal(other Value) bool
- func (value Thunk) Eval(_ context.Context, _ *Scope, cont Cont) ReadyCont
- func (thunk Thunk) Extend(sub Path) (Path, error)
- func (thunk Thunk) MarshalJSON() ([]byte, error)
- func (value Thunk) MarshalProto() (proto.Message, error)
- func (thunk Thunk) Name() string
- func (thunk Thunk) Open(ctx context.Context) (io.ReadCloser, error)
- func (thunk *Thunk) Platform() *Platform
- func (thunk Thunk) Proto() (*proto.Thunk, error)
- func (thunk Thunk) Read(ctx context.Context, w io.Writer) error
- func (thunk Thunk) Run(ctx context.Context) error
- func (wl Thunk) SHA256() (string, error)
- func (thunk Thunk) Start(ctx context.Context, handler Combiner) (Combiner, error)
- func (thunk Thunk) String() string
- func (thunk *Thunk) UnmarshalJSON(b []byte) error
- func (thunk *Thunk) UnmarshalProto(msg proto.Message) error
- func (combiner Thunk) Unwrap() Combiner
- func (thunk Thunk) WithArgs(args []Value) Thunk
- func (thunk Thunk) WithCmd(cmd ThunkCmd) Thunk
- func (thunk Thunk) WithDir(dir ThunkDir) Thunk
- func (thunk Thunk) WithEnv(env *Scope) Thunk
- func (thunk Thunk) WithImage(image ThunkImage) Thunk
- func (thunk Thunk) WithInsecure(insecure bool) Thunk
- func (thunk Thunk) WithLabel(key Symbol, val Value) Thunk
- func (thunk Thunk) WithMount(src ThunkMountSource, tgt FileOrDirPath) Thunk
- func (thunk Thunk) WithStdin(stdin []Value) Thunk
- type ThunkCmd
- func (path *ThunkCmd) FromValue(val Value) error
- func (cmd ThunkCmd) Inner() (Value, error)
- func (path ThunkCmd) MarshalJSON() ([]byte, error)
- func (cmd ThunkCmd) MarshalProto() (proto.Message, error)
- func (cmd ThunkCmd) ToValue() Value
- func (path *ThunkCmd) UnmarshalJSON(payload []byte) error
- func (cmd *ThunkCmd) UnmarshalProto(msg proto.Message) error
- type ThunkDir
- func (path *ThunkDir) FromValue(val Value) error
- func (path ThunkDir) MarshalJSON() ([]byte, error)
- func (dir ThunkDir) MarshalProto() (proto.Message, error)
- func (path ThunkDir) ToValue() Value
- func (path *ThunkDir) UnmarshalJSON(payload []byte) error
- func (dir *ThunkDir) UnmarshalProto(msg proto.Message) error
- type ThunkImage
- func (image *ThunkImage) FromValue(val Value) error
- func (image ThunkImage) MarshalJSON() ([]byte, error)
- func (img ThunkImage) MarshalProto() (proto.Message, error)
- func (img ThunkImage) Platform() *Platform
- func (image ThunkImage) ToValue() Value
- func (image *ThunkImage) UnmarshalJSON(payload []byte) error
- func (img *ThunkImage) UnmarshalProto(msg proto.Message) error
- type ThunkImageRef
- type ThunkMount
- type ThunkMountSource
- func (enum *ThunkMountSource) FromValue(val Value) error
- func (enum ThunkMountSource) MarshalJSON() ([]byte, error)
- func (src ThunkMountSource) MarshalProto() (proto.Message, error)
- func (enum ThunkMountSource) ToValue() Value
- func (enum *ThunkMountSource) UnmarshalJSON(payload []byte) error
- func (mount *ThunkMountSource) UnmarshalProto(msg proto.Message) error
- type ThunkOperative
- func (op ThunkOperative) Call(_ context.Context, args Value, _ *Scope, cont Cont) ReadyCont
- func (value ThunkOperative) Decode(dest any) error
- func (value ThunkOperative) Equal(other Value) bool
- func (value ThunkOperative) Eval(_ context.Context, _ *Scope, cont Cont) ReadyCont
- func (value ThunkOperative) String() string
- type ThunkPath
- func (path ThunkPath) CachePath(ctx context.Context, dest string) (string, error)
- func (combiner ThunkPath) Call(ctx context.Context, val Value, scope *Scope, cont Cont) ReadyCont
- func (value ThunkPath) Decode(dest any) error
- func (path ThunkPath) Dir() ThunkPath
- func (value ThunkPath) Equal(other Value) bool
- func (value ThunkPath) Eval(_ context.Context, _ *Scope, cont Cont) ReadyCont
- func (path ThunkPath) Extend(ext Path) (Path, error)
- func (value ThunkPath) MarshalJSON() ([]byte, error)
- func (value ThunkPath) MarshalProto() (proto.Message, error)
- func (path ThunkPath) Name() string
- func (path ThunkPath) Open(ctx context.Context) (io.ReadCloser, error)
- func (wl ThunkPath) SHA256() (string, error)
- func (value ThunkPath) String() string
- func (value *ThunkPath) UnmarshalJSON(b []byte) error
- func (value *ThunkPath) UnmarshalProto(msg proto.Message) error
- func (app ThunkPath) Unwrap() Combiner
- type Trace
- type UnboundError
- type UnixTableProtocol
- type UnknownProtocolError
- type Value
- func EvalFSFile(ctx context.Context, scope *Scope, source *FSPath) (Value, error)
- func EvalFile(ctx context.Context, scope *Scope, filePath string, source Readable) (Value, error)
- func EvalReader(ctx context.Context, e *Scope, r io.Reader, source Readable) (Value, error)
- func EvalString(ctx context.Context, e *Scope, str string, source Readable) (Value, error)
- func FromProto(val *proto.Value) (Value, error)
- func Resolve(val Value, r func(Value) (Value, error)) (Value, error)
- func ToSlice(list List) ([]Value, error)
- func Trampoline(ctx context.Context, val Value) (Value, error)
- func ValueOf(src any) (Value, error)
- func WithMeta(val Value, metaVal Value) (Value, error)
- type Wrapped
- func (combiner Wrapped) Call(ctx context.Context, val Value, scope *Scope, cont Cont) ReadyCont
- func (value Wrapped) Decode(dest any) error
- func (value Wrapped) Equal(other Value) bool
- func (value Wrapped) Eval(_ context.Context, _ *Scope, cont Cont) ReadyCont
- func (value Wrapped) MarshalJSON() ([]byte, error)
- func (value Wrapped) String() string
- func (app Wrapped) Unwrap() Combiner
- type WriteFlusher
Constants ¶
const Ext = ".bass"
Ext is the canonical file extension for Bass source code.
const TraceSize = 1000
Variables ¶
var Bass = NewBass()
Bass is the canonical global session for running Bass scripts.
var CacheHome string
CacheHome is the directory where Bass stores caches.
var Clock = clockwork.NewRealClock()
Clock is used to determine the current time.
var ErrBadSyntax = errors.New("bad syntax")
var ErrEndOfSource = errors.New("end of source")
var ErrInterrupted = errors.New("interrupted")
var ErrNoRuntimePool = errors.New("runtime not initialized")
ErrNoRuntimePool is returned when the context.Context does not have a runtime pool set.
var Ground = NewEmptyScope()
Ground is the scope providing the standard library.
var Identity = Continue(func(v Value) Value {
return v
})
var LinuxPlatform = Platform{
OS: "linux",
}
LinuxPlatform is the minimum configuration to select a Linux runtime.
var Protocols = map[Symbol]Protocol{ "raw": RawProtocol{}, "json": JSONProtocol{}, "unix-table": UnixTableProtocol{}, }
Protocols defines the set of supported protocols for reading responses.
var Secrets = NewEmptyScope()
var Stdin = &Source{ NewJSONSource("stdin", os.Stdin), }
var Stdout = &Sink{ NewJSONSink("stdout", os.Stdout), }
Functions ¶
func Cache ¶ added in v0.6.0
Cache exports a readable file path to a local path if it does not already exist.
Does not preserve file permissions and timestamps. Only use for accessing the content of a Readable.
func DecodeProto ¶
DecodeProto uses the named protocol to decode values from r into the sink.
func EncodeList ¶ added in v0.5.0
func EncodeList(list List, enc zapcore.ArrayEncoder) error
func IsApplicative ¶
IsApplicative returns true iff the value is an Applicative.
func IsOperative ¶
IsOperative returns true iff the value is an Operative or a Builtin operative.
func IsPathLike ¶ added in v0.5.0
func MarshalJSON ¶
func UnmarshalJSON ¶
func WithRuntimePool ¶
func WithRuntimePool(ctx context.Context, pool RuntimePool) context.Context
Types ¶
type Annotate ¶
type Annotate struct { // Value the inner form whose value will be annotated. Value // Range is the source code location of the inner form. Range Range // Comment is a literal comment ahead of or following the inner form. Comment string // Meta is an optional binding form that will be evaluated to attach metadata // to the inner form's value. Meta *Bind }
func (Annotate) MarshalJSON ¶
type AnnotateBinding ¶
func (AnnotateBinding) Decode ¶
func (value AnnotateBinding) Decode(dest any) error
func (AnnotateBinding) EachBinding ¶
func (binding AnnotateBinding) EachBinding(cb func(Symbol, Range) error) error
type Annotated ¶
type Annotated struct { // Value is the inner value. Value // Meta contains metadata about the inner value. Meta *Scope }
func (Annotated) MarshalJSON ¶
type Applicative ¶
func Func ¶
func Func(name, formals string, f any) Applicative
func Wrap ¶
func Wrap(comb Combiner) Applicative
type ArityError ¶
func (ArityError) Error ¶
func (err ArityError) Error() string
type Bind ¶
type Bind []Value
func (Bind) EachBinding ¶ added in v0.5.0
func (Bind) MarshalJSON ¶
type BindMismatchError ¶
func (BindMismatchError) Error ¶
func (err BindMismatchError) Error() string
type Bindable ¶
type Bindable interface { Value // Bind assigns values to symbols in the given scope. Bind(context.Context, *Scope, Cont, Value, ...Annotated) ReadyCont // EachBinding calls the fn for each symbol that will be bound. EachBinding(func(Symbol, Range) error) error }
Bindable is any value which may be used to destructure a value into bindings in a scope.
type CannotBindError ¶
type CannotBindError struct {
Have Value
}
func (CannotBindError) Error ¶
func (err CannotBindError) Error() string
type CommandPath ¶
type CommandPath struct {
Command string `json:"command"`
}
CommandPath represents a command path in an abstract runtime environment, typically resolved by consulting $PATH.
func (CommandPath) Decode ¶
func (value CommandPath) Decode(dest any) error
func (CommandPath) EachBinding ¶
func (CommandPath) EachBinding(func(Symbol, Range) error) error
func (CommandPath) Equal ¶
func (value CommandPath) Equal(other Value) bool
func (CommandPath) MarshalProto ¶ added in v0.6.0
func (value CommandPath) MarshalProto() (proto.Message, error)
func (CommandPath) Name ¶
func (value CommandPath) Name() string
func (CommandPath) String ¶
func (value CommandPath) String() string
func (*CommandPath) UnmarshalProto ¶ added in v0.6.0
func (path *CommandPath) UnmarshalProto(msg proto.Message) error
func (CommandPath) Unwrap ¶
func (app CommandPath) Unwrap() Combiner
type CompleteOpt ¶
type CompleteOpts ¶
type CompleteOpts []CompleteOpt
func (CompleteOpts) Len ¶
func (opts CompleteOpts) Len() int
func (CompleteOpts) Less ¶
func (opts CompleteOpts) Less(i, j int) bool
func (CompleteOpts) Swap ¶
func (opts CompleteOpts) Swap(i, j int)
type Config ¶
type Config struct {
Runtimes []RuntimeConfig `json:"runtimes"`
}
Config is set by the user and read by the Bass language and runtimes which run on the same machine.
func LoadConfig ¶
LoadConfig loads a Config from the JSON file at the given path.
type Cons ¶
type Cons Pair
func (Cons) MarshalJSON ¶
func (Cons) MarshalLogArray ¶ added in v0.5.0
func (cons Cons) MarshalLogArray(enc zapcore.ArrayEncoder) error
type Continuation ¶
func (*Continuation) Decode ¶
func (value *Continuation) Decode(dest any) error
func (*Continuation) Equal ¶
func (value *Continuation) Equal(other Value) bool
func (*Continuation) MarshalJSON ¶
func (value *Continuation) MarshalJSON() ([]byte, error)
func (*Continuation) String ¶
func (value *Continuation) String() string
func (*Continuation) Traced ¶
func (value *Continuation) Traced(trace *Trace) Cont
type CrossSource ¶ added in v0.5.0
type CrossSource struct {
// contains filtered or unexported fields
}
func (*CrossSource) Next ¶ added in v0.5.0
func (cross *CrossSource) Next(ctx context.Context) (Value, error)
func (*CrossSource) String ¶ added in v0.5.0
func (cross *CrossSource) String() string
type DecodeError ¶
func (DecodeError) Error ¶
func (err DecodeError) Error() string
type Decoder ¶ added in v0.5.0
type Decoder struct {
// contains filtered or unexported fields
}
func NewDecoder ¶
type DirPath ¶
type DirPath struct {
Path string `json:"dir"`
}
DirPath represents a directory path in an abstract filesystem.
Its interpretation is context-dependent; it may refer to a path in a runtime environment, or a path on the local machine.
func (DirPath) MarshalProto ¶ added in v0.6.0
func (*DirPath) UnmarshalProto ¶ added in v0.6.0
type Empty ¶
type Empty struct{}
func (Empty) MarshalJSON ¶
func (Empty) MarshalLogArray ¶ added in v0.5.0
func (Empty) MarshalLogArray(enc zapcore.ArrayEncoder) error
func (*Empty) UnmarshalJSON ¶
type Encodable ¶
type Encodable interface {
ToValue() Value
}
Encodable types typically implement json.Marshaler as well.
type EncodeError ¶
type EncodeError struct {
Value Value
}
func (EncodeError) Error ¶
func (err EncodeError) Error() string
type ExtendError ¶
func (ExtendError) Error ¶
func (err ExtendError) Error() string
type ExtendOperative ¶
type ExtendOperative struct {
Path Path
}
ExtendOperative is an operative which constructs a Extend.
func (ExtendOperative) Decode ¶
func (value ExtendOperative) Decode(dest any) error
func (ExtendOperative) Equal ¶
func (value ExtendOperative) Equal(other Value) bool
func (ExtendOperative) String ¶
func (value ExtendOperative) String() string
type ExtendPath ¶
type ExtendPath struct { Parent Value Child FilesystemPath }
ExtendPath extends a parent path expression with a child path.
func (ExtendPath) Decode ¶
func (value ExtendPath) Decode(dest any) error
func (ExtendPath) EachBinding ¶
func (ExtendPath) EachBinding(func(Symbol, Range) error) error
func (ExtendPath) Equal ¶
func (value ExtendPath) Equal(other Value) bool
func (ExtendPath) String ¶
func (value ExtendPath) String() string
type FSPath ¶
type FSPath struct { FS fs.FS `json:"-"` Path FileOrDirPath `json:"path"` }
FSPath is a Path representing a file or directory relative to a filesystem.
This type will typically never occur in production code. It is only used for embedded filesystems, i.e. in Bass's stdlib and test suites.
JSON tags are specified just for keeping up appearances - this type needs to be marshalable just to support .SHA256, .Name, .Avatar, etc. on a Thunk that embeds it.
func NewInMemoryFSDir ¶
NewInMemoryFSDir is exposed as (mkfs) - it takes alternating file paths and content and constructs an in-memory filesystem path.
func NewInMemoryFile ¶ added in v0.6.0
func (*FSPath) MarshalProto ¶ added in v0.6.0
func (*FSPath) UnmarshalProto ¶ added in v0.6.0
type FileOrDirPath ¶
FileOrDirPath is an enum type that accepts a FilePath or a DirPath.
func NewFileOrDirPath ¶
func NewFileOrDirPath(path FilesystemPath) FileOrDirPath
func ParseFileOrDirPath ¶
func ParseFileOrDirPath(arg string) FileOrDirPath
ParseFileOrDirPath parses arg as a path using the host machine's separator convention.
If the path is '.' or has a trailing slash, a DirPath is returned.
Otherwise, a FilePath is returned.
func (FileOrDirPath) Extend ¶
func (path FileOrDirPath) Extend(ext Path) (FileOrDirPath, error)
Extend extends the value with the given path and returns it wrapped in another FileOrDirPath.
func (FileOrDirPath) FilesystemPath ¶
func (path FileOrDirPath) FilesystemPath() FilesystemPath
FilesystemPath returns the value present.
func (*FileOrDirPath) FromValue ¶
func (path *FileOrDirPath) FromValue(val Value) error
FromValue decodes val into a FilePath or a DirPath, setting whichever worked as the internal value.
func (FileOrDirPath) MarshalJSON ¶
func (value FileOrDirPath) MarshalJSON() ([]byte, error)
func (FileOrDirPath) MarshalProto ¶ added in v0.6.0
func (fod FileOrDirPath) MarshalProto() (proto.Message, error)
func (FileOrDirPath) Slash ¶ added in v0.6.0
func (path FileOrDirPath) Slash() string
Slash calls Slash on whichever value is present.
func (FileOrDirPath) ToValue ¶
func (path FileOrDirPath) ToValue() Value
ToValue returns the value present.
func (*FileOrDirPath) UnmarshalJSON ¶
func (value *FileOrDirPath) UnmarshalJSON(b []byte) error
func (*FileOrDirPath) UnmarshalProto ¶ added in v0.6.0
func (path *FileOrDirPath) UnmarshalProto(msg proto.Message) error
type FilePath ¶
type FilePath struct {
Path string `json:"file"`
}
FilePath represents a file path in an abstract filesystem.
Its interpretation is context-dependent; it may refer to a path in a runtime environment, or a path on the local machine.
func (FilePath) FileOrDir ¶
func (app FilePath) FileOrDir() FileOrDirPath
func (FilePath) MarshalProto ¶ added in v0.6.0
func (*FilePath) UnmarshalProto ¶ added in v0.6.0
type FilesystemPath ¶
type FilesystemPath interface { Path // Slash returns the path representation with forward slash path separators. Slash() string // FromSlash uses filepath.FromSlash to convert the path to host machine's // path separators. FromSlash() string // IsDir returns true if the path refers to a directory. IsDir() bool // Dir returns the parent directory of the path, or the same directory if // there is no parent. Dir() DirPath }
FilesystemPath is a Path representing a file or directory in a filesystem.
type FormAnalyzer ¶
type HostPath ¶
type HostPath struct { ContextDir string `json:"context"` Path FileOrDirPath `json:"path"` }
HostPath is a Path representing an absolute path on the host machine's filesystem.
func NewHostDir ¶
func NewHostPath ¶
func NewHostPath(contextDir string, path FileOrDirPath) HostPath
func ParseHostPath ¶ added in v0.6.0
func (HostPath) MarshalProto ¶ added in v0.6.0
func (*HostPath) UnmarshalProto ¶ added in v0.6.0
type HostPathEscapeError ¶ added in v0.6.0
HostPathEscapeError is returned when an attempt is made to (read) a host path that traverses outside of its context dir.
func (HostPathEscapeError) Error ¶ added in v0.6.0
func (err HostPathEscapeError) Error() string
type InMemorySink ¶
type InMemorySink struct {
Values []Value
}
func NewInMemorySink ¶
func NewInMemorySink() *InMemorySink
func (*InMemorySink) Emit ¶
func (src *InMemorySink) Emit(val Value) error
func (*InMemorySink) Reset ¶
func (sink *InMemorySink) Reset()
func (*InMemorySink) Source ¶
func (sink *InMemorySink) Source() PipeSource
func (*InMemorySink) String ¶
func (src *InMemorySink) String() string
type InMemorySource ¶
type InMemorySource struct {
// contains filtered or unexported fields
}
func NewInMemorySource ¶
func NewInMemorySource(vals ...Value) *InMemorySource
func (*InMemorySource) String ¶
func (src *InMemorySource) String() string
type JSONProtocol ¶
type JSONProtocol struct{}
JSON protocol decodes a values from JSON stream.
func (JSONProtocol) DecodeInto ¶
DecodeInto decodes a JSON stream from r and emits values to the sink.
type JSONSource ¶
type JSONSource struct { Name string // contains filtered or unexported fields }
func NewJSONSource ¶
func NewJSONSource(name string, in io.Reader) *JSONSource
func (*JSONSource) String ¶
func (source *JSONSource) String() string
type Keyword ¶
type Keyword string
type List ¶
func NewConsList ¶
type Lockfile ¶
type Lockfile struct {
// contains filtered or unexported fields
}
func NewLockfileMemo ¶
type Memos ¶
type Memos interface { Store(Thunk, Symbol, Value, Value) error Retrieve(Thunk, Symbol, Value) (Value, bool, error) Remove(Thunk, Symbol, Value) error }
Memos is where memoized calls are cached.
type NiceError ¶
NiceError is an error that is able to provide some extra guidance to the user.
Strive for all errors returned by Bass to become a NiceError.
type Null ¶
type Null struct{}
type Pair ¶
func (Pair) Eval ¶
Pair combines the first operand with the second operand.
If the first value is not a Combiner, an error is returned.
func (Pair) MarshalJSON ¶
func (Pair) MarshalLogArray ¶ added in v0.5.0
func (pair Pair) MarshalLogArray(enc zapcore.ArrayEncoder) error
func (*Pair) UnmarshalJSON ¶
type Path ¶
type Path interface { // All Paths are Values. Value // Name returns the unqualified name for the path, i.e. the base name of a // file or directory, or the name of a command. Name() string // Extend returns a path referring to the given path relative to the parent // Path. Extend(Path) (Path, error) }
Path is an abstract location identifier for files, directories, or executable commands.
type PipeSource ¶
type Platform ¶
Platform configures an OCI image platform.
type ProtoMarshaler ¶ added in v0.6.0
type ProtoUnmarshaler ¶ added in v0.6.0
type Protocol ¶
type Protocol interface { // DecodeInto decodes values from the reader and emits them to the sink. DecodeInto(context.Context, PipeSink, io.Reader) error }
Protocol determines how response data is parsed from a thunk's response.
type PruneOpts ¶
type PruneOpts struct { // Prune everything. All bool // Keep data last used within the duration. KeepDuration time.Duration // Keep KeepBytes int64 }
PruneOpts contains parameters to fine-tune the pruning behavior. These parameters are best-effort; not all runtimes are expected to support every option.
type RawProtocol ¶
type RawProtocol struct{}
Raw protocol buffers the entire stream and writes it as a single JSON string on flush.
func (RawProtocol) DecodeInto ¶
DecodeInto reads the full content from r and emits it to the sink as a one big string.
type Readable ¶
type Readable interface { Value // CachePath returns a local file path to the content for caching purposes. // // Caches may be created under the given dest if needed. Implementations must // take care not to clobber each other's caches. CachePath(ctx context.Context, dest string) (string, error) // Open opens the resource for reading. Open(context.Context) (io.ReadCloser, error) }
Readable is any Value that can be (read).
type Reader ¶
type Reader struct { File Readable Analyzer FormAnalyzer Context context.Context // contains filtered or unexported fields }
type ReadonlyMemos ¶
type ReadonlyMemos struct {
Content *proto.Memosphere
}
func (ReadonlyMemos) Remove ¶
func (file ReadonlyMemos) Remove(thunk Thunk, binding Symbol, input Value) error
type ReadyContinuation ¶
type ReadyContinuation struct { Cont *Continuation Result Value Err error }
func (*ReadyContinuation) Decode ¶
func (value *ReadyContinuation) Decode(dest any) error
func (*ReadyContinuation) Equal ¶
func (value *ReadyContinuation) Equal(other Value) bool
func (*ReadyContinuation) Go ¶
func (cont *ReadyContinuation) Go() (Value, error)
func (*ReadyContinuation) MarshalJSON ¶
func (value *ReadyContinuation) MarshalJSON() ([]byte, error)
func (*ReadyContinuation) String ¶
func (cont *ReadyContinuation) String() string
type Runs ¶ added in v0.6.0
type Runs struct {
// contains filtered or unexported fields
}
func RunsFromContext ¶ added in v0.6.0
type Runtime ¶
type Runtime interface { Resolve(context.Context, ThunkImageRef) (ThunkImageRef, error) Run(context.Context, Thunk) error Read(context.Context, io.Writer, Thunk) error Export(context.Context, io.Writer, Thunk) error ExportPath(context.Context, io.Writer, ThunkPath) error Prune(context.Context, PruneOpts) error Close() error }
type RuntimeAddrs ¶ added in v0.6.0
RuntimeAddrs contains addresses of various services.
func (RuntimeAddrs) Service ¶ added in v0.6.0
func (addrs RuntimeAddrs) Service(name string) (*url.URL, bool)
func (*RuntimeAddrs) UnmarshalJSON ¶ added in v0.6.0
func (addrs *RuntimeAddrs) UnmarshalJSON(p []byte) error
type RuntimeConfig ¶
type RuntimeConfig struct { Platform Platform `json:"platform"` Runtime string `json:"runtime"` Addrs RuntimeAddrs `json:"addrs,omitempty"` Config *Scope `json:"config,omitempty"` }
RuntimeConfig associates a platform object to a runtime command to run.
Additional configuration may be specified; it will be read from the runtime by finding the config associated to the platform on the thunk it receives.
type RuntimePool ¶
func RuntimePoolFromContext ¶
func RuntimePoolFromContext(ctx context.Context) (RuntimePool, error)
type Scope ¶
type Scope struct { // an optional name for the scope, used to prettify .String on 'standard' // environments Name string Parents []*Scope Bindings Bindings Order []Symbol }
Scope contains bindings from symbols to values, and parent scopes to delegate to during symbol lookup.
var Internal *Scope = NewEmptyScope()
func ImportSystemEnv ¶
func ImportSystemEnv() *Scope
ImportSystemEnv converts the system env into a scope, clearing the system env in the process. This is a destructive operation.
func NewEmptyScope ¶
NewEmptyScope constructs a new scope with no bindings and optional parents.
func NewRunScope ¶ added in v0.6.0
func NewStandardScope ¶
func NewStandardScope() *Scope
NewStandardScope returns a new empty scope with Ground as its sole parent.
func (*Scope) Complete ¶
func (scope *Scope) Complete(prefix string) []CompleteOpt
Complete queries the scope for bindings beginning with the given prefix.
Local bindings are listed before parent bindings, with shorter binding names listed first.
func (*Scope) Each ¶
Reduce calls f for each binding-value pair mapped by the scope.
Note that shadowed bindings will be skipped.
func (*Scope) Get ¶
Get fetches the given binding.
If a value is set in the local bindings, it is returned.
If not, the parent scopes are queried in order.
If no value is found, false is returned.
func (*Scope) IsSubsetOf ¶
func (*Scope) MarshalJSON ¶
func (*Scope) MarshalLogObject ¶ added in v0.5.0
func (scope *Scope) MarshalLogObject(enc zapcore.ObjectEncoder) error
func (*Scope) MarshalProto ¶ added in v0.6.0
func (*Scope) UnmarshalJSON ¶
type Secret ¶
type Secret struct { Name string `json:"secret"` // contains filtered or unexported fields }
func (Secret) Decode ¶
Decode only supports decoding into a Secret or Value; it will not reveal the inner secret.
func (Secret) MarshalJSON ¶ added in v0.6.0
func (Secret) MarshalProto ¶ added in v0.6.0
func (*Secret) UnmarshalJSON ¶ added in v0.6.0
type Session ¶ added in v0.6.0
type Session struct {
// contains filtered or unexported fields
}
type Source ¶
type Source struct {
PipeSource PipeSource
}
func NewSource ¶
func NewSource(ps PipeSource) *Source
func (*Source) MarshalJSON ¶
type String ¶
type String string
func (String) MarshalProto ¶ added in v0.6.0
type StructuredError ¶ added in v0.5.0
func (*StructuredError) Error ¶ added in v0.5.0
func (err *StructuredError) Error() string
type Symbol ¶
type Symbol string
var ( DocMetaBinding Symbol = "doc" FileMetaBinding Symbol = "file" LineMetaBinding Symbol = "line" ColumnMetaBinding Symbol = "column" )
DocMetaBinding is the binding in meta that stores the value's doc string.
func Predicates ¶
Predicates returns a list of all builtin predicates which return true for the given value.
func SymbolFromJSONKey ¶
type SymbolOperative ¶
type SymbolOperative struct {
Symbol Symbol
}
func (SymbolOperative) Decode ¶
func (value SymbolOperative) Decode(dest any) error
func (SymbolOperative) Equal ¶
func (value SymbolOperative) Equal(other Value) bool
func (SymbolOperative) String ¶
func (value SymbolOperative) String() string
type Thunk ¶
type Thunk struct { // Image specifies the OCI image in which to run the thunk. Image *ThunkImage `json:"image,omitempty"` // Insecure may be set to true to enable running the thunk with elevated // privileges. Its meaning is determined by the runtime. Insecure bool `json:"insecure,omitempty"` // Cmd identifies the file or command to run. Cmd ThunkCmd `json:"cmd"` // Args is a list of string or path arguments to pass to the command. Args []Value `json:"args,omitempty"` // Stdin is a list of arbitrary values, which may contain paths, to pass to // the command. Stdin []Value `json:"stdin,omitempty"` // Env is a mapping from environment variables to their string or path // values. Env *Scope `json:"env,omitempty"` // Dir configures a working directory in which to run the command. // // Note that a working directory is automatically provided to thunks by // the runtime. A relative Dir value will be relative to this working // directory, not the OCI image's initial working directory. The OCI image's // working directory is ignored. // // A relative directory path will be relative to the initial working // directory. An absolute path will be relative to the OCI image root. // // A thunk directory path may also be provided. It will be mounted to the // container and used as the working directory of the command. Dir *ThunkDir `json:"dir,omitempty"` // Mounts configures explicit mount points for the thunk, in addition to // any provided in Path, Args, Stdin, Env, or Dir. Mounts []ThunkMount `json:"mounts,omitempty"` // Labels specify arbitrary fields for identifying the thunk, typically // used to influence caching behavior. // // For example, thunks which may return different results over time should // embed the current timestamp truncated to a certain amount of granularity, // e.g. one minute. Doing so prevents the first call from being cached // forever while still allowing some level of caching to take place. Labels *Scope `json:"labels,omitempty"` }
func (Thunk) AppendArgs ¶ added in v0.6.0
AppendArgs appends to the thunk's arg values.
func (Thunk) Cmdline ¶
Cmdline returns a human-readable representation of the thunk's command and args.
func (Thunk) Extend ¶
Extend returns a path referring to the given path relative to the parent Path.
func (Thunk) MarshalJSON ¶ added in v0.6.0
func (Thunk) MarshalProto ¶ added in v0.6.0
func (Thunk) Name ¶
Name returns the unqualified name for the path, i.e. the base name of a file or directory, or the name of a command.
func (Thunk) Start ¶ added in v0.6.0
Start forks a goroutine that runs the thunk and calls handler with a boolean indicating whether it succeeded. It returns a combiner which waits for the thunk to finish and returns the result of the handler.
func (*Thunk) UnmarshalJSON ¶
func (*Thunk) UnmarshalProto ¶ added in v0.6.0
func (Thunk) WithImage ¶
func (thunk Thunk) WithImage(image ThunkImage) Thunk
WithImage sets the base image of the thunk, recursing into parent thunks until it reaches the bottom, like a rebase.
func (Thunk) WithInsecure ¶
WithInsecure sets whether the thunk should be run insecurely.
func (Thunk) WithMount ¶
func (thunk Thunk) WithMount(src ThunkMountSource, tgt FileOrDirPath) Thunk
WithMount adds a mount.
type ThunkCmd ¶
type ThunkCmd struct { Cmd *CommandPath File *FilePath Thunk *ThunkPath Host *HostPath FS *FSPath }
func (ThunkCmd) MarshalJSON ¶
func (ThunkCmd) MarshalProto ¶ added in v0.6.0
func (*ThunkCmd) UnmarshalJSON ¶
type ThunkDir ¶
func (ThunkDir) MarshalJSON ¶
func (ThunkDir) MarshalProto ¶ added in v0.6.0
func (*ThunkDir) UnmarshalJSON ¶
type ThunkImage ¶
type ThunkImage struct { Ref *ThunkImageRef Thunk *Thunk }
ThunkImage specifies the base image of a thunk - either a reference to be fetched, a thunk path (e.g. of a OCI/Docker tarball), or a lower thunk to run.
func (*ThunkImage) FromValue ¶
func (image *ThunkImage) FromValue(val Value) error
func (ThunkImage) MarshalJSON ¶
func (image ThunkImage) MarshalJSON() ([]byte, error)
func (ThunkImage) MarshalProto ¶ added in v0.6.0
func (img ThunkImage) MarshalProto() (proto.Message, error)
func (ThunkImage) Platform ¶
func (img ThunkImage) Platform() *Platform
func (ThunkImage) ToValue ¶
func (image ThunkImage) ToValue() Value
func (*ThunkImage) UnmarshalJSON ¶
func (image *ThunkImage) UnmarshalJSON(payload []byte) error
func (*ThunkImage) UnmarshalProto ¶ added in v0.6.0
func (img *ThunkImage) UnmarshalProto(msg proto.Message) error
type ThunkImageRef ¶
type ThunkImageRef struct { // The platform to target; influences runtime selection. Platform Platform `json:"platform"` // A reference to an image hosted on a registry. Repository string `json:"repository,omitempty"` // An OCI image archive tarball to load. File *ThunkPath `json:"file,omitempty"` // The tag to use, either from the repository or in a multi-tag OCI archive. Tag string `json:"tag,omitempty"` // An optional digest for maximally reprodicuble builds. Digest string `json:"digest,omitempty"` }
ThunkImageRef specifies an OCI image uploaded to a registry.
func (ThunkImageRef) MarshalProto ¶ added in v0.6.0
func (ref ThunkImageRef) MarshalProto() (proto.Message, error)
func (ThunkImageRef) Ref ¶
func (ref ThunkImageRef) Ref() (string, error)
func (*ThunkImageRef) UnmarshalProto ¶ added in v0.6.0
func (ref *ThunkImageRef) UnmarshalProto(msg proto.Message) error
type ThunkMount ¶
type ThunkMount struct { Source ThunkMountSource `json:"source"` Target FileOrDirPath `json:"target"` }
ThunkMount configures a mount for the thunk.
func (ThunkMount) MarshalProto ¶ added in v0.6.0
func (mount ThunkMount) MarshalProto() (proto.Message, error)
func (*ThunkMount) UnmarshalProto ¶ added in v0.6.0
func (mount *ThunkMount) UnmarshalProto(msg proto.Message) error
type ThunkMountSource ¶
type ThunkMountSource struct { ThunkPath *ThunkPath HostPath *HostPath FSPath *FSPath Cache *FileOrDirPath Secret *Secret }
func (*ThunkMountSource) FromValue ¶
func (enum *ThunkMountSource) FromValue(val Value) error
func (ThunkMountSource) MarshalJSON ¶
func (enum ThunkMountSource) MarshalJSON() ([]byte, error)
func (ThunkMountSource) MarshalProto ¶ added in v0.6.0
func (src ThunkMountSource) MarshalProto() (proto.Message, error)
func (ThunkMountSource) ToValue ¶
func (enum ThunkMountSource) ToValue() Value
func (*ThunkMountSource) UnmarshalJSON ¶
func (enum *ThunkMountSource) UnmarshalJSON(payload []byte) error
func (*ThunkMountSource) UnmarshalProto ¶ added in v0.6.0
func (mount *ThunkMountSource) UnmarshalProto(msg proto.Message) error
type ThunkOperative ¶
type ThunkOperative struct {
Cmd ThunkCmd
}
ThunkOperative is an operative which constructs a Thunk.
func (ThunkOperative) Decode ¶
func (value ThunkOperative) Decode(dest any) error
func (ThunkOperative) Equal ¶
func (value ThunkOperative) Equal(other Value) bool
func (ThunkOperative) String ¶
func (value ThunkOperative) String() string
type ThunkPath ¶
type ThunkPath struct { Thunk Thunk `json:"thunk"` Path FileOrDirPath `json:"path"` }
A path created by a thunk.
func (ThunkPath) MarshalJSON ¶ added in v0.6.0
func (ThunkPath) MarshalProto ¶ added in v0.6.0
func (*ThunkPath) UnmarshalJSON ¶
func (*ThunkPath) UnmarshalProto ¶ added in v0.6.0
type UnboundError ¶
func (UnboundError) Error ¶
func (err UnboundError) Error() string
type UnixTableProtocol ¶
type UnixTableProtocol struct{}
UnixTableProtocol parses lines of tabular output with columns separated by whitespace.
Each row is not guaranteed to have the same number of columns. Empty lines correspond to empty arrays.
func (UnixTableProtocol) DecodeInto ¶
DecodeInto decodes from r and emits lists of strings to the sink.
type UnknownProtocolError ¶
type UnknownProtocolError struct {
Protocol Symbol
}
UnknownProtocolError is returned when a thunk specifies an unknown response protocol.
func (UnknownProtocolError) Error ¶
func (err UnknownProtocolError) Error() string
type Value ¶
type Value interface { fmt.Stringer // Eval continues execution with a new value (or the same value, for consts). Eval(context.Context, *Scope, Cont) ReadyCont // Equal checks whether two values are equal, i.e. same type and equivalent // value. Equal(Value) bool // Decode coerces and assigns the Value into the given type, analogous to // unmarshaling. // // If the given type is a direct implementor of Value, it must only // successfully decode from another instance of that type. // // If the given type is a Go primitive, it must do its best to coerce into // that type. For example, null can Decode into bool, but not Bool. // // TODO: move this to Encodable/Decodable or something (or rename all this if // it's so confusing) Decode(any) error }
Value represents any value used by Bass programs.
func EvalReader ¶
func EvalString ¶
type Wrapped ¶
type Wrapped struct {
Underlying Combiner
}
func (Wrapped) Call ¶
Call evaluates the value in the scope and calls the underlying combiner with the result.
func (Wrapped) MarshalJSON ¶
type WriteFlusher ¶
WriteFlusher is a flushable io.Writer, to support protocols which have to maintain an internal buffer.
Source Files
¶
- across.go
- annotated.go
- applicative.go
- bind.go
- bool.go
- builtin.go
- cache.go
- combiners.go
- config.go
- cons.go
- continuation.go
- doc.go
- empty.go
- env.go
- errors.go
- eval.go
- filesystem_path.go
- fspath.go
- ground.go
- host_path.go
- ignore.go
- int.go
- internal.go
- json.go
- keyword.go
- list.go
- log.go
- memfs.go
- memo.go
- null.go
- operative.go
- pair.go
- path.go
- pipes.go
- predicates.go
- proto.go
- protocol.go
- range.go
- readable.go
- reader.go
- run_scope.go
- runs.go
- runtime.go
- scope.go
- script.go
- secret.go
- session.go
- stdlib.go
- string.go
- symbol.go
- thunk.go
- thunk_path.go
- thunk_types.go
- trace.go
- value.go