binder

package
v0.0.0-...-8c2001a Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoPanicWrap = true

Functions

This section is empty.

Types

type Binder

type Binder struct {
	Deps      *Factory
	Namespace string
	PlugId    string
	AgentId   string
	BprintId  string
	EventId   string

	Context  context.Context
	Executor etypes.Executor
	Logger   zerolog.Logger

	Job *job.Job

	Resp []byte

	ReuseCounter int32
	Epoch        int64
	// contains filtered or unexported fields
}

func (*Binder) AsyncEventPoll

func (b *Binder) AsyncEventPoll(mid int32, eid uint32) (xtypes.LazyData, error)

func (*Binder) AsyncEventWait

func (b *Binder) AsyncEventWait(mid int32, eid uint32) (xtypes.LazyData, error)

func (*Binder) AsyncLinkExec

func (b *Binder) AsyncLinkExec(name, method string, data xtypes.LazyData) (uint32, error)

func (*Binder) AsyncModuleExec

func (b *Binder) AsyncModuleExec(mid int32, method string, data xtypes.LazyData) (uint32, error)

func (*Binder) AttachJob

func (b *Binder) AttachJob(j *job.Job)

func (*Binder) Clone

func (b *Binder) Clone() bindx.Core

func (*Binder) ExecMethod

func (b *Binder) ExecMethod(method string, data xtypes.LazyData) (xtypes.LazyData, error)

func (*Binder) Execute

func (b *Binder) Execute() (*event.Response, error)

func (*Binder) ForkExec

func (b *Binder) ForkExec(method string, data []byte) error

func (*Binder) GetApp

func (b *Binder) GetApp() any

func (*Binder) GetFileWithMeta

func (b *Binder) GetFileWithMeta(file string) ([]byte, int64, error)

func (*Binder) GetInvoker

func (b *Binder) GetInvoker() bindx.Invoker

func (*Binder) GetResource

func (b *Binder) GetResource(name string) (*bindx.Resource, error)

func (*Binder) HttpFetch

func (b *Binder) HttpFetch(req *bindx.HttpRequest) *bindx.HttpResponse
func (b *Binder) InLinks() ([]bindx.Link, error)

func (*Binder) LazyLog

func (b *Binder) LazyLog(msgs []string)

func (*Binder) LinkExec

func (b *Binder) LinkExec(name, method string, data xtypes.LazyData) (xtypes.LazyData, error)

func (*Binder) LinkExecEmit

func (b *Binder) LinkExecEmit(name, method string, data xtypes.LazyData) error

func (*Binder) ListResources

func (b *Binder) ListResources() ([]*bindx.Resource, error)

func (*Binder) Log

func (b *Binder) Log(msg string)

func (*Binder) ModuleExec

func (b *Binder) ModuleExec(mid int32, method string, data xtypes.LazyData) (xtypes.LazyData, error)

func (*Binder) ModuleTicket

func (b *Binder) ModuleTicket(name string, opts xtypes.LazyData) (string, error)

func (*Binder) Name

func (b *Binder) Name() string

func (*Binder) NewModule

func (b *Binder) NewModule(name string, data xtypes.LazyData) (int32, error)
func (b *Binder) OutLinks() ([]bindx.Link, error)

func (*Binder) SetExec

func (b *Binder) SetExec(exec etypes.Executor)

func (*Binder) Sleep

func (b *Binder) Sleep(msec int32)

func (*Binder) UserContext

func (b *Binder) UserContext() *claim.UserContext

func (*Binder) UserInfo

func (b *Binder) UserInfo() (*entities.UserInfo, error)

func (*Binder) UserMessage

func (b *Binder) UserMessage(opts *bindx.UserMessage) error

type BinderOptions

type BinderOptions struct {
	Namespace string
	PlugId    string
	AgentId   string
	BprintId  string
	Epoch     int64
}

type CabinetFolder

type CabinetFolder struct {
	Prefix      string   `json:"prefix,omitempty"`
	PinnedFiles []string `json:"pinned_files,omitempty"`
	Operations  []string `json:"ops,omitempty"`
}

type DataGroup

type DataGroup struct {
	ReadOnly bool `json:"read_only,omitempty"`
}

type Factory

type Factory struct {
	App            xtypes.App
	Corehub        store.CoreHub
	CabinetHub     store.CabinetHub
	Sockd          sockdx.SockdCore
	Pacman         repox.Hub
	LoggerBase     zerolog.Logger
	NodeCache      service.NodeCache
	PlugKV         store.PlugStateKV
	Runtime        etypes.Runtime
	ModuleBuilders map[string]etypes.ModuleBuilder
	ExecBuilders   map[string]etypes.ExecutorBuilder
	Signer         service.Signer
}

func NewFactory

func NewFactory(opts FactoryOptions) Factory

func (*Factory) New

func (bf *Factory) New(opts BinderOptions) *Binder

type FactoryOptions

type FactoryOptions struct {
	App          xtypes.App
	Logger       zerolog.Logger
	Modules      map[string]etypes.ModuleBuilder
	ExecBuilders map[string]etypes.ExecutorBuilder
	Runtime      etypes.Runtime
}

type PlugState

type PlugState struct {
	KeyPrefix string `json:"key_prefix,omitempty"`
}

type SockdRoom

type SockdRoom struct {
	AllowBroadcast string `json:"allow_broadcast,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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