代码拉取完成,页面将自动刷新
package endly
import (
"github.com/viant/toolbox"
"github.com/viant/toolbox/data"
"sync"
)
// AppName represents endly application name
const AppName = "endly"
// Namespace represents endly namespace
const Namespace = "github.com/viant/endly/"
// Manager represents a endly service manager
type Manager interface {
//Name returns an application SessionID
Name() string
//Version returns an application version
Version() string
//Service return a workflow service for provided SessionID, request, or error
Service(input interface{}) (Service, error)
//Register register service in this manager
Register(service Service)
//NewContext returns new workflow context.
NewContext(context toolbox.Context) *Context
//Run run requests
Run(context *Context, request interface{}) (interface{}, error)
}
// Service represents an endly service
type Service interface {
//service id
ID() string
//service state map
State() data.Map
//Run service action for supported request types.
Run(context *Context, request interface{}) *ServiceResponse
//Route returns service action route
Route(action string) (*Route, error)
Mutex() *sync.RWMutex
Actions() []string
}
// Validator represents generic validator
type Validator interface {
Validate() error
}
// Initializer represents generic initializer
type Initializer interface {
Init() error
}
// ServiceResponse service response
type ServiceResponse struct {
Status string
Error string
Response interface{}
Err error
}
// Route represents service action route
type Route struct {
Action string
RequestInfo *ActionInfo
ResponseInfo *ActionInfo
RequestProvider func() interface{}
ResponseProvider func() interface{}
Handler func(context *Context, request interface{}) (interface{}, error)
OnRawRequest func(context *Context, rawRequest map[string]interface{}) error //when specified it is called each time action literal is used when match
}
// Description represents example use case
type UseCase struct {
Description string
Data string
}
// ActionInfo represent an action info
type ActionInfo struct {
Description string
Examples []*UseCase
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。