Versions in this module Expand all Collapse all v5 v5.0.0 Mar 1, 2023 Changes in this version + const ArrayFormatCSV + const ArrayFormatMulti + const ArrayFormatPipe + const ArrayFormatSSV + const ArrayFormatTSV + const Commit + const Complete + const ExecutionTimeout + const RelationTypeMany + const RelationTypeOne + const Rollback + var ErrFileNotExist = errors.New("File doesn't exist") + type Action struct + func (a *Action) Call(service string, version string, action string, params []*Param, files []File, ...) (returnValue interface{}, err error) + func (a *Action) Commit(action string, params []*Param) (*Action, error) + func (a *Action) Complete(action string, params []*Param) (*Action, error) + func (a *Action) DeferCall(service, version, action string, params []*Param, files []File) (*Action, error) + func (a *Action) Error(message string, code int, status string) *Action + func (a *Action) GetActionName() string + func (a *Action) GetFile(name string) File + func (a *Action) GetFiles() (files []File) + func (a *Action) GetParam(name string) *Param + func (a *Action) GetParams() (params []*Param) + func (a *Action) HasFile(name string) bool + func (a *Action) HasParam(name string) bool + func (a *Action) IsOrigin() bool + func (a *Action) NewFile(name, path, mimeType string) (*File, error) + func (a *Action) NewParam(name string, value interface{}, dataType string) (*Param, error) + func (a *Action) RelateMany(pk, service string, fks []string) (*Action, error) + func (a *Action) RelateManyRemote(pk, address, service string, fks []string) (*Action, error) + func (a *Action) RelateOne(pk, service, fk string) (*Action, error) + func (a *Action) RelateOneRemote(pk, address, service, fk string) (*Action, error) + func (a *Action) RemoteCall(address string, service string, version string, action string, params []*Param, ...) (*Action, error) + func (a *Action) Rollback(action string, params []*Param) (*Action, error) + func (a *Action) SetCollection(collection interface{}) (*Action, error) + func (a *Action) SetDownload(f File) (*Action, error) + func (a *Action) SetEntity(entity interface{}) (*Action, error) + func (a *Action) SetLink(link, uri string) (*Action, error) + func (a *Action) SetProperty(name, value string) *Action + func (a *Action) SetReturn(value interface{}) (*Action, error) + type ActionCallback func(*Action) (*Action, error) + type ActionData struct + func (a ActionData) GetData() []interface{} + func (a ActionData) GetName() string + func (a ActionData) IsCollection() bool + type ActionSchema struct + func (s ActionSchema) GetCalls() (calls [][]string) + func (s ActionSchema) GetDeferCalls() (calls [][]string) + func (s ActionSchema) GetEntity() *Entity + func (s ActionSchema) GetEntityPath() string + func (s ActionSchema) GetFileSchema(name string) (*FileSchema, error) + func (s ActionSchema) GetFiles() (files []string) + func (s ActionSchema) GetHTTPSchema() *HTTPActionSchema + func (s ActionSchema) GetName() string + func (s ActionSchema) GetParamSchema(name string) (*ParamSchema, error) + func (s ActionSchema) GetParams() (params []string) + func (s ActionSchema) GetPathDelimiter() string + func (s ActionSchema) GetRelations() (relations [][]string) + func (s ActionSchema) GetRemoteCalls() (calls [][]string) + func (s ActionSchema) GetReturnType() (string, error) + func (s ActionSchema) GetTags() (tags []string) + func (s ActionSchema) GetTimeout() uint + func (s ActionSchema) HasCall(name, version, action string) bool + func (s ActionSchema) HasCalls() bool + func (s ActionSchema) HasDeferCall(name, version, action string) bool + func (s ActionSchema) HasDeferCalls() bool + func (s ActionSchema) HasEntity() bool + func (s ActionSchema) HasFile(name string) bool + func (s ActionSchema) HasParam(name string) bool + func (s ActionSchema) HasRelations() bool + func (s ActionSchema) HasRemoteCall(address, name, version, action string) bool + func (s ActionSchema) HasRemoteCalls() bool + func (s ActionSchema) HasReturn() bool + func (s ActionSchema) HasTag(name string) bool + func (s ActionSchema) IsCollection() bool + func (s ActionSchema) IsDeprecated() bool + func (s ActionSchema) ResolveEntity(data map[string]interface{}) (map[string]interface{}, error) + type Api struct + func (a *Api) Done() <-chan struct{} + func (a *Api) GetFrameworkVersion() string + func (a *Api) GetName() string + func (a *Api) GetPath() string + func (a *Api) GetResource(name string) (interface{}, error) + func (a *Api) GetServiceSchema(name, version string) (*ServiceSchema, error) + func (a *Api) GetServices() []payload.ServiceVersion + func (a *Api) GetVariable(name string) string + func (a *Api) GetVariables() map[string]string + func (a *Api) GetVersion() string + func (a *Api) HasResource(name string) bool + func (a *Api) HasVariable(name string) bool + func (a *Api) IsDebug() bool + func (a *Api) Log(value interface{}, level int) (*Api, error) + type Callback func(Component) error + type Callee struct + func (c Callee) GetAction() string + func (c Callee) GetAddress() string + func (c Callee) GetDuration() uint + func (c Callee) GetName() string + func (c Callee) GetParams() (params []*Param) + func (c Callee) GetTimeout() uint + func (c Callee) GetVersion() string + func (c Callee) IsRemote() bool + type Caller struct + func (c Caller) GetAction() string + func (c Caller) GetCallee() Callee + func (c Caller) GetName() string + func (c Caller) GetVersion() string + type Component interface + Error func(callback ErrorCallback) Component + GetResource func(name string) (interface{}, error) + HasResource func(name string) bool + Log func(value interface{}, level int) Component + Run func() bool + SetResource func(name string, factory ResourceFactory) error + Shutdown func(callback Callback) Component + Startup func(callback Callback) Component + type Entity struct + Field []Field + Fields []ObjectField + Name string + Primarykey string + Validate bool + func (e Entity) IsEmpty() bool + type Error struct + func (e Error) GetAddress() string + func (e Error) GetCode() int + func (e Error) GetMessage() string + func (e Error) GetName() string + func (e Error) GetStatus() string + func (e Error) GetVersion() string + type ErrorCallback func(error) error + type Field struct + Name string + Optional bool + Type string + type File struct + func NewFile(name, path, mimeType, filename string, size uint, token string) (*File, error) + func (f File) CopyWithMime(mimeType string) *File + func (f File) CopyWithName(name string) *File + func (f File) Exists() bool + func (f File) GetFilename() string + func (f File) GetMime() string + func (f File) GetName() string + func (f File) GetPath() string + func (f File) GetSize() uint + func (f File) GetToken() string + func (f File) IsLocal() bool + func (f File) Read() (contents []byte, err error) + type FileSchema struct + func (s FileSchema) GetHTTPSchema() *HTTPFileSchema + func (s FileSchema) GetMax() uint + func (s FileSchema) GetMime() string + func (s FileSchema) GetMin() uint + func (s FileSchema) GetName() string + func (s FileSchema) IsExclusiveMax() bool + func (s FileSchema) IsExclusiveMin() bool + func (s FileSchema) IsRequired() bool + type ForeignRelation struct + func (r ForeignRelation) GetAddress() string + func (r ForeignRelation) GetForeignKeys() (fks []string) + func (r ForeignRelation) GetName() string + func (r ForeignRelation) GetType() string + type HTTPActionSchema struct + func (s HTTPActionSchema) GetBody() string + func (s HTTPActionSchema) GetInput() string + func (s HTTPActionSchema) GetMethod() string + func (s HTTPActionSchema) GetPath() string + func (s HTTPActionSchema) IsAccesible() bool + type HTTPFileSchema struct + func (s HTTPFileSchema) GetParam() string + func (s HTTPFileSchema) IsAccesible() bool + type HTTPParamSchema struct + func (s HTTPParamSchema) GetInput() string + func (s HTTPParamSchema) GetParam() string + func (s HTTPParamSchema) IsAccesible() bool + type HTTPRequest struct + func (r HTTPRequest) GetBody() []byte + func (r HTTPRequest) GetFile(name string) File + func (r HTTPRequest) GetFiles() (files []File) + func (r HTTPRequest) GetHeader(name, preset string) string + func (r HTTPRequest) GetHeaderArray(name string, preset []string) []string + func (r HTTPRequest) GetHeaders() map[string]string + func (r HTTPRequest) GetHeadersArray() map[string][]string + func (r HTTPRequest) GetMethod() string + func (r HTTPRequest) GetPostParam(name, preset string) string + func (r HTTPRequest) GetPostParamArray(name string, preset []string) []string + func (r HTTPRequest) GetPostParams() map[string]string + func (r HTTPRequest) GetPostParamsArray() map[string][]string + func (r HTTPRequest) GetProtocolVersion() string + func (r HTTPRequest) GetQueryParam(name, preset string) string + func (r HTTPRequest) GetQueryParamArray(name string, preset []string) []string + func (r HTTPRequest) GetQueryParams() map[string]string + func (r HTTPRequest) GetQueryParamsArray() map[string][]string + func (r HTTPRequest) GetURL() string + func (r HTTPRequest) GetURLHost() string + func (r HTTPRequest) GetURLPath() string + func (r HTTPRequest) GetURLPort() int + func (r HTTPRequest) GetURLScheme() string + func (r HTTPRequest) HasBody() bool + func (r HTTPRequest) HasFile(name string) bool + func (r HTTPRequest) HasHeader(name string) bool + func (r HTTPRequest) HasPostParam(name string) bool + func (r HTTPRequest) HasQueryParam(name string) bool + func (r HTTPRequest) IsMethod(name string) bool + func (r HTTPRequest) IsProtocolVersion(version string) bool + type HTTPResponse struct + func (r *HTTPResponse) GetBody() []byte + func (r *HTTPResponse) GetHeader(name, preset string) string + func (r *HTTPResponse) GetHeaderArray(name string, preset []string) []string + func (r *HTTPResponse) GetHeaders() map[string]string + func (r *HTTPResponse) GetHeadersArray() map[string][]string + func (r *HTTPResponse) GetProtocolVersion() string + func (r *HTTPResponse) GetStatus() string + func (r *HTTPResponse) GetStatusCode() int + func (r *HTTPResponse) GetStatusText() string + func (r *HTTPResponse) HasBody() bool + func (r *HTTPResponse) HasHeader(name string) bool + func (r *HTTPResponse) IsProtocolVersion(version string) bool + func (r *HTTPResponse) IsStatus(status string) bool + func (r *HTTPResponse) SetBody(content []byte) *HTTPResponse + func (r *HTTPResponse) SetHeader(name, value string, overwrite bool) *HTTPResponse + func (r *HTTPResponse) SetProtocolVersion(version string) *HTTPResponse + func (r *HTTPResponse) SetStatus(code int, text string) *HTTPResponse + type HTTPServiceSchema struct + func (s HTTPServiceSchema) IsAccesible() bool + type Link struct + func (l Link) GetAddress() string + func (l Link) GetLink() string + func (l Link) GetName() string + func (l Link) GetURI() string + type Middleware struct + func NewMiddleware() *Middleware + func (c *Middleware) Error(callback ErrorCallback) Component + func (c *Middleware) GetResource(name string) (interface{}, error) + func (c *Middleware) HasResource(name string) bool + func (c *Middleware) Log(value interface{}, level int) Component + func (c *Middleware) Run() bool + func (c *Middleware) SetResource(name string, factory ResourceFactory) error + func (c *Middleware) Shutdown(callback Callback) Component + func (c *Middleware) Startup(callback Callback) Component + func (m *Middleware) Request(callback RequestCallback) *Middleware + func (m *Middleware) Response(callback ResponseCallback) *Middleware + type ObjectField struct + Field []Field + Fields []ObjectField + Name string + Optional bool + type Param struct + func (p *Param) CopyWithName(name string) *Param + func (p *Param) CopyWithType(valueType string) (*Param, error) + func (p *Param) CopyWithValue(value interface{}) *Param + func (p *Param) Exists() bool + func (p *Param) GetName() string + func (p *Param) GetType() string + func (p *Param) GetValue() interface{} + type ParamSchema struct + func (s ParamSchema) AllowEmpty() bool + func (s ParamSchema) GetArrayFormat() string + func (s ParamSchema) GetDefaultValue() interface{} + func (s ParamSchema) GetEnum() []interface{} + func (s ParamSchema) GetFormat() string + func (s ParamSchema) GetHTTPSchema() *HTTPParamSchema + func (s ParamSchema) GetItems() (map[string]interface{}, error) + func (s ParamSchema) GetMax() int + func (s ParamSchema) GetMaxItems() int + func (s ParamSchema) GetMin() int + func (s ParamSchema) GetMinItems() int + func (s ParamSchema) GetMultipleOf() int + func (s ParamSchema) GetName() string + func (s ParamSchema) GetPattern() string + func (s ParamSchema) GetType() string + func (s ParamSchema) HasDefaultValue() bool + func (s ParamSchema) HasUniqueItems() bool + func (s ParamSchema) IsExclusiveMax() bool + func (s ParamSchema) IsExclusiveMin() bool + func (s ParamSchema) IsRequired() bool + type Relation struct + func (r Relation) GetAddress() string + func (r Relation) GetForeignRelations() (relations []ForeignRelation) + func (r Relation) GetName() string + func (r Relation) GetPrimaryKey() string + type Request struct + func (r *Request) GetActionName() string + func (r *Request) GetClientAddress() string + func (r *Request) GetGatewayAddress() string + func (r *Request) GetGatewayProtocol() string + func (r *Request) GetHTTPRequest() *HTTPRequest + func (r *Request) GetID() string + func (r *Request) GetParam(name string) *Param + func (r *Request) GetParams() (params []*Param) + func (r *Request) GetServiceName() string + func (r *Request) GetServiceVersion() string + func (r *Request) GetTimestamp() string + func (r *Request) HasParam(name string) bool + func (r *Request) NewParam(name string, value interface{}, dataType string) (*Param, error) + func (r *Request) NewResponse(code int, text string) *Response + func (r *Request) SetActionName(name string) *Request + func (r *Request) SetAttribute(name, value string) *Request + func (r *Request) SetParam(p *Param) *Request + func (r *Request) SetServiceName(name string) *Request + func (r *Request) SetServiceVersion(version string) *Request + type RequestCallback func(*Request) (interface{}, error) + type ResourceFactory func(Component) (interface{}, error) + type Response struct + func (r *Response) GetGatewayAddress() string + func (r *Response) GetGatewayProtocol() string + func (r *Response) GetHTTPRequest() *HTTPRequest + func (r *Response) GetHTTPResponse() *HTTPResponse + func (r *Response) GetRequestAttribute(name, preset string) string + func (r *Response) GetRequestAttributes() map[string]string + func (r *Response) GetReturn() (interface{}, error) + func (r *Response) GetTransport() *Transport + func (r *Response) HasReturn() bool + type ResponseCallback func(*Response) (*Response, error) + type Service struct + func NewService() *Service + func (c *Service) Error(callback ErrorCallback) Component + func (c *Service) GetResource(name string) (interface{}, error) + func (c *Service) HasResource(name string) bool + func (c *Service) Log(value interface{}, level int) Component + func (c *Service) Run() bool + func (c *Service) SetResource(name string, factory ResourceFactory) error + func (c *Service) Shutdown(callback Callback) Component + func (c *Service) Startup(callback Callback) Component + func (s *Service) Action(name string, callback ActionCallback) *Service + type ServiceData struct + func (s ServiceData) GetActions() (actions []ActionData) + func (s ServiceData) GetAddress() string + func (s ServiceData) GetName() string + func (s ServiceData) GetVersion() string + type ServiceSchema struct + func (s ServiceSchema) GetActionNames() (actions []string) + func (s ServiceSchema) GetActionSchema(name string) (*ActionSchema, error) + func (s ServiceSchema) GetBasePath() string + func (s ServiceSchema) GetHTTPSchema() *HTTPServiceSchema + func (s ServiceSchema) GetName() string + func (s ServiceSchema) GetVersion() string + func (s ServiceSchema) HasAction(name string) bool + func (s ServiceSchema) HasFileServer() bool + type Transaction struct + func (t Transaction) GetCalleeAction() string + func (t Transaction) GetCallerAction() string + func (t Transaction) GetName() string + func (t Transaction) GetParams() (params []*Param) + func (t Transaction) GetType() string + func (t Transaction) GetVersion() string + type Transport struct + func (t Transport) GetCalls() (callers []Caller) + func (t Transport) GetData() (data []ServiceData) + func (t Transport) GetDownload() *File + func (t Transport) GetErrors() (result []Error) + func (t Transport) GetLinks() (links []Link) + func (t Transport) GetOriginDuration() uint + func (t Transport) GetOriginService() []string + func (t Transport) GetProperties() map[string]string + func (t Transport) GetProperty(name, preset string) string + func (t Transport) GetRelations() (relations []Relation) + func (t Transport) GetRequestID() string + func (t Transport) GetRequestTimestamp() string + func (t Transport) GetTransactions(command string) ([]Transaction, error) + func (t Transport) HasDownload() bool Other modules containing this package github.com/kusanagi/kusanagi-sdk-go/v4