script

package
v0.13.4 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAnonymousRole = "anonymous"
	DefaultUserRole      = "user"
	DefaultUserIdKey     = "userId"
	DefaultRolesKey      = "roles"
)
View Source
const GlobalKey = "globalThis"

Variables

This section is empty.

Functions

This section is empty.

Types

type CtxData added in v0.11.8

type CtxData map[string]any

func (CtxData) AddRoles added in v0.11.8

func (c CtxData) AddRoles(roles []string)

func (CtxData) Roles added in v0.11.8

func (c CtxData) Roles() []string

type GlobalThis

type GlobalThis map[string]any

func (GlobalThis) Copy added in v0.11.9

func (m GlobalThis) Copy(sourceMap map[string]any)

func (GlobalThis) CtxData added in v0.11.8

func (m GlobalThis) CtxData() map[string]any

func (GlobalThis) Env

func (m GlobalThis) Env() map[string]any

func (GlobalThis) Input

func (m GlobalThis) Input() any

func (GlobalThis) Meta added in v0.10.0

func (m GlobalThis) Meta() map[string]any

func (GlobalThis) Output

func (m GlobalThis) Output() any

func (GlobalThis) Server

func (m GlobalThis) Server() map[string]any

func (GlobalThis) Session

func (m GlobalThis) Session() map[string]any

func (GlobalThis) SetCtxData added in v0.11.8

func (m GlobalThis) SetCtxData(key string, value any)

func (GlobalThis) SetEnv

func (m GlobalThis) SetEnv(env map[string]any)

func (GlobalThis) SetInput

func (m GlobalThis) SetInput(input any)

func (GlobalThis) SetMeta added in v0.10.0

func (m GlobalThis) SetMeta(metas map[string]any)

func (GlobalThis) SetOutput

func (m GlobalThis) SetOutput(output any)

func (GlobalThis) SetServer

func (m GlobalThis) SetServer(server map[string]any)

func (GlobalThis) SetSession

func (m GlobalThis) SetSession(sess map[string]any)

type InputWrapper added in v0.9.1

type InputWrapper struct {
	// contains filtered or unexported fields
}

func Input added in v0.9.1

func Input(v any) *InputWrapper

func (*InputWrapper) Current added in v0.9.1

func (i *InputWrapper) Current() int

func (*InputWrapper) LimitOffset added in v0.9.1

func (i *InputWrapper) LimitOffset() (int, int)

func (*InputWrapper) PageSize added in v0.9.1

func (i *InputWrapper) PageSize() int

type Meta added in v0.10.0

type Meta map[string]any

func (Meta) AddRoles added in v0.10.0

func (m Meta) AddRoles(roles []string)

func (Meta) AppKey added in v0.10.0

func (m Meta) AppKey() string

func (Meta) Roles added in v0.10.0

func (m Meta) Roles() []string

func (Meta) SessionId added in v0.10.0

func (m Meta) SessionId() string

func (Meta) SetAppKey added in v0.10.0

func (m Meta) SetAppKey(appKey string)

func (Meta) SetSessionId added in v0.10.0

func (m Meta) SetSessionId(sessionId string)

func (Meta) SetSoftware added in v0.10.0

func (m Meta) SetSoftware(software string)

func (Meta) SetToken added in v0.10.0

func (m Meta) SetToken(accessToken string)

func (Meta) Software added in v0.10.0

func (m Meta) Software() string

func (Meta) Token added in v0.10.0

func (m Meta) Token() string

type RunnerContext

type RunnerContext struct {
	ParsedName   *method.ParsedName
	MetaProvider *bundle.MetaProvider
	DalCtx       *dbop.DalContext

	GlobalThis map[string]any
	DebugInfo  map[string]any
	// contains filtered or unexported fields
}

func NewRunnerContext added in v0.13.3

func NewRunnerContext(ctx context.Context) *RunnerContext

func (*RunnerContext) Context added in v0.13.3

func (r *RunnerContext) Context() context.Context

type Server added in v0.9.1

type Server map[string]any

func (Server) AddRespHeader added in v0.10.0

func (m Server) AddRespHeader(key, value string)

func (Server) ApiName added in v0.9.1

func (m Server) ApiName() string

func (Server) RemoteAddr added in v0.9.1

func (m Server) RemoteAddr() string

func (Server) RemoteHost added in v0.9.1

func (m Server) RemoteHost() string

func (Server) ReqHeader added in v0.10.0

func (m Server) ReqHeader() map[string]string

func (Server) RequestId added in v0.9.4

func (m Server) RequestId() string

func (Server) RequestTime added in v0.9.1

func (m Server) RequestTime() int64

func (Server) RespHeader added in v0.10.0

func (m Server) RespHeader() map[string]string

func (Server) SetApiName added in v0.9.1

func (m Server) SetApiName(apiName string)

func (Server) SetRemoteAddr added in v0.9.1

func (m Server) SetRemoteAddr(remoteAddr string)

func (Server) SetRemoteHost added in v0.9.1

func (m Server) SetRemoteHost(remoteHost string)

func (Server) SetReqHeader added in v0.10.0

func (m Server) SetReqHeader(header map[string]string)

func (Server) SetRequestId added in v0.9.4

func (m Server) SetRequestId(remoteHost string)

func (Server) SetRequestTime added in v0.9.1

func (m Server) SetRequestTime(timestamp int64)

Jump to

Keyboard shortcuts

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