Documentation ¶
Index ¶
- func ApplicationIsRunning(ctx context.Context) (ok bool)
- func CanAccessInternal(ctx context.Context) (ok bool)
- func Fork(ctx context.Context, task Task)
- func GetApplicationId(ctx context.Context) (appId string)
- func GetLog(ctx context.Context) (log logs.Logger)
- func GetOutboundChannel(ctx context.Context, listener string, name string) (channel listeners.OutboundChannel, has bool)
- func SetLog(ctx context.Context, log logs.Logger) context.Context
- func SetRequest(ctx context.Context, r Request) context.Context
- func SetTracer(ctx context.Context) context.Context
- func TryFork(ctx context.Context, task Task) (ok bool)
- type Abstract
- type Argument
- type Barrier
- type Component
- type ComponentOptions
- type Document
- type ElementDocument
- type Empty
- type Endpoint
- type EndpointDiscovery
- type Endpoints
- type EndpointsOptions
- type FnDocument
- type FutureResult
- type Handler
- type Listenable
- type Metric
- type Options
- type Request
- type RequestHeader
- type RequestLocal
- type RequestUser
- type Result
- type ResultWriter
- type Service
- type Span
- type Task
- type Tracer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplicationIsRunning ¶
func CanAccessInternal ¶
func GetApplicationId ¶
func GetOutboundChannel ¶
Types ¶
type Abstract ¶
type Abstract struct {
// contains filtered or unexported fields
}
func (*Abstract) Components ¶
type Argument ¶
type Argument interface { json.Marshaler json.Unmarshaler As(v interface{}) (err errors.CodeError) }
func EmptyArgument ¶
func EmptyArgument() (arg Argument)
func NewArgument ¶
func NewArgument(v interface{}) (arg Argument)
type Component ¶
type Component interface { Name() (name string) Build(options ComponentOptions) (err error) Close() }
type ComponentOptions ¶
type ComponentOptions struct { Log logs.Logger Config configures.Config }
type Document ¶
type Document interface { Name() (name string) Description() (description string) Fns() []FnDocument Elements() (elements map[string]ElementDocument) }
type ElementDocument ¶
type Endpoint ¶
type EndpointDiscovery ¶
type Endpoints ¶
type Endpoints interface { Handler Mount(svc Service) RegisterOutboundChannels(name string, channels listeners.OutboundChannels) Documents() (v map[string]Document) SetupContext(ctx context.Context) context.Context Close() }
func NewEndpoints ¶
func NewEndpoints(options EndpointsOptions) (v Endpoints)
type EndpointsOptions ¶
type FnDocument ¶
type FnDocument interface { Name() (name string) Title() (title string) Description() (description string) Authorization() (has bool) Deprecated() (deprecated bool) Argument() (argument ElementDocument) Result() (result ElementDocument) }
type FutureResult ¶
type FutureResult interface { ResultWriter Result }
func NewResult ¶
func NewResult() FutureResult
type Listenable ¶
type Request ¶
type Request interface { Id() (id string) Internal() (ok bool) Authorization() (v string) RemoteIp() (v string) User() (user RequestUser) SetUser(id string, attr *json.Object) Local() (local RequestLocal) Header() (header RequestHeader) Fn() (service string, fn string) Argument() (argument Argument) Hash() (code string) }
func NewInternalRequest ¶
type RequestHeader ¶
type RequestHeader interface { Contains(key string) (ok bool) Get(key string) (value string) Values(key string) (values []string) Raw() (v http.Header) }
func NewRequestHeader ¶
func NewRequestHeader(value http.Header) RequestHeader
type RequestLocal ¶
type RequestLocal interface { json.Marshaler Scan(key string, value interface{}) (has bool, err errors.CodeError) Put(key string, value interface{}) Remove(key string) }
func NewRequestLocal ¶ added in v0.12.6
func NewRequestLocal() (v RequestLocal)
type RequestUser ¶
type RequestUser interface { json.Marshaler json.Unmarshaler Authenticated() (ok bool) Id() (id string) IntId() (id int64) Attributes() (attributes *json.Object) }
func GetRequestUser ¶ added in v0.13.7
func GetRequestUser(ctx context.Context) (user RequestUser, authenticated bool)
func NewRequestUser ¶
func NewRequestUser(id string, attributes *json.Object) (u RequestUser)
type ResultWriter ¶
type Service ¶
type Service interface { Build(options Options) (err error) Name() (name string) Internal() (internal bool) Components() (components map[string]Component) Document() (doc Document) Handle(context context.Context, fn string, argument Argument) (v interface{}, err errors.CodeError) Close() }
Service 管理 Fn 的服务
Source Files ¶
Click to show internal directories.
Click to hide internal directories.