Documentation ¶
Index ¶
- Variables
- type Application
- type ApplicationWithRelationship
- type Attempt
- type AttemptState
- type AttemptTask
- type AttemptTrigger
- type AuditTime
- type Endpoint
- type EndpointMessage
- type EndpointRule
- type Entity
- type Header
- func (h Header) Add(key, value string)
- func (h Header) Del(key string)
- func (h Header) FromHTTP(headers http.Header)
- func (h Header) Get(key string) string
- func (h Header) Merge(src Header)
- func (h *Header) Scan(value interface{}) error
- func (h Header) Set(key, value string)
- func (h Header) String() string
- func (h Header) ToHTTP() http.Header
- func (h Header) Value() (driver.Value, error)
- func (h Header) Values(key string) []string
- type Message
- type Metadata
- type PagingQuery
- type RecoveryTask
- type Request
- type Response
- type ScanningQuery
- type ScanningResult
- type TSEntity
- type Workspace
- type WorkspaceCredentials
- type WorkspaceSnapshot
- type WorkspaceSnapshotApp
- type WorkspaceSnapshotEp
- type WorkspaceSnapshotEpr
Constants ¶
This section is empty.
Variables ¶
View Source
var ( HeaderIdempotencyKey = "idempotency-key" HeaderWebhookId = "webhook-id" HeaderWebhookTs = "webhook-timestamp" HeaderWebhookSign = "webhook-signature" HeaderWebhookRef = "webhook-ref" )
View Source
var ( IdNsWs = "ws" IdNsWsc = "wsc" IdNsApp = "app" IdNsEp = "ep" IdNsEpr = "epr" IdNsMsg = "msg" IdNsReq = "req" IdNsRes = "res" )
View Source
var ( MetaAttId = "kanthor.att.id" MetaAttState = "kanthor.att.state" MetaEprId = "kanthor.epr.id" )
View Source
var ( TableWs = project.NameWithoutTier("workspace") TableWsc = project.NameWithoutTier("workspace_credentials") TableApp = project.NameWithoutTier("application") TableEp = project.NameWithoutTier("endpoint") TableEpr = project.NameWithoutTier("endpoint_rule") TableMsg = project.NameWithoutTier("message") TableReq = project.NameWithoutTier("request") TableRes = project.NameWithoutTier("response") TableAtt = project.NameWithoutTier("attempt") )
View Source
var DefaultPagingLimitMax = 100
View Source
var DefaultPagingLimitMin = 5
View Source
var DefaultPagingPageMax = 100
View Source
var DefaultPagingPageMin = 1
View Source
var DefaultPagingQuery = &PagingQuery{ Limit: DefaultPagingLimitMin, Page: DefaultPagingPageMin, }
View Source
var MessageMappers = map[string]func(doc *Message) any{ "id": func(doc *Message) any { return doc.Id }, "timestamp": func(doc *Message) any { return doc.Timestamp }, "tier": func(doc *Message) any { return doc.Tier }, "app_id": func(doc *Message) any { return doc.AppId }, "type": func(doc *Message) any { return doc.Type }, "metadata": func(doc *Message) any { return doc.Metadata.String() }, "headers": func(doc *Message) any { return doc.Headers.String() }, "body": func(doc *Message) any { return doc.Body }, }
View Source
var MessageProps = []string{
"id",
"timestamp",
"tier",
"app_id",
"type",
"metadata",
"headers",
"body",
}
View Source
var RequestMappers = map[string]func(doc *Request) any{ "id": func(doc *Request) any { return doc.Id }, "timestamp": func(doc *Request) any { return doc.Timestamp }, "msg_id": func(doc *Request) any { return doc.MsgId }, "ep_id": func(doc *Request) any { return doc.EpId }, "tier": func(doc *Request) any { return doc.Tier }, "app_id": func(doc *Request) any { return doc.AppId }, "type": func(doc *Request) any { return doc.Type }, "metadata": func(doc *Request) any { return doc.Metadata.String() }, "headers": func(doc *Request) any { return doc.Headers.String() }, "body": func(doc *Request) any { return doc.Body }, "uri": func(doc *Request) any { return doc.Uri }, "method": func(doc *Request) any { return doc.Method }, }
View Source
var RequestProps = []string{
"id",
"timestamp",
"msg_id",
"ep_id",
"tier",
"app_id",
"type",
"metadata",
"headers",
"body",
"uri",
"method",
}
View Source
var ResponseMappers = map[string]func(doc *Response) any{ "id": func(doc *Response) any { return doc.Id }, "timestamp": func(doc *Response) any { return doc.Timestamp }, "msg_id": func(doc *Response) any { return doc.MsgId }, "ep_id": func(doc *Response) any { return doc.EpId }, "req_id": func(doc *Response) any { return doc.ReqId }, "tier": func(doc *Response) any { return doc.Tier }, "app_id": func(doc *Response) any { return doc.AppId }, "type": func(doc *Response) any { return doc.Type }, "metadata": func(doc *Response) any { return doc.Metadata.String() }, "headers": func(doc *Response) any { return doc.Headers.String() }, "body": func(doc *Response) any { return doc.Body }, "uri": func(doc *Response) any { return doc.Uri }, "status": func(doc *Response) any { return doc.Status }, "error": func(doc *Response) any { return doc.Error }, }
View Source
var ResponseProps = []string{
"id",
"timestamp",
"msg_id",
"ep_id",
"req_id",
"tier",
"app_id",
"type",
"metadata",
"headers",
"body",
"uri",
"status",
"error",
}
Functions ¶
This section is empty.
Types ¶
type Application ¶
func (*Application) Marshal ¶
func (entity *Application) Marshal() ([]byte, error)
func (*Application) String ¶
func (entity *Application) String() string
func (*Application) TableName ¶
func (entity *Application) TableName() string
func (*Application) Unmarshal ¶
func (entity *Application) Unmarshal(data []byte) error
func (*Application) Validate ¶
func (entity *Application) Validate() error
type ApplicationWithRelationship ¶
type ApplicationWithRelationship struct { *Application Workspace *Workspace }
type AttemptState ¶
type AttemptState struct { ScheduleCounter int `json:"schedule_counter"` ScheduleNext int64 `json:"schedule_next"` ScheduledAt int64 `json:"scheduled_at"` CompletedAt int64 `json:"completed_at"` CompletedId string `json:"completed_id"` }
func (*AttemptState) String ¶
func (entity *AttemptState) String() string
type AttemptTask ¶
func (*AttemptTask) Marshal ¶
func (entity *AttemptTask) Marshal() ([]byte, error)
func (*AttemptTask) String ¶
func (entity *AttemptTask) String() string
func (*AttemptTask) Unmarshal ¶
func (entity *AttemptTask) Unmarshal(data []byte) error
type AttemptTrigger ¶
func (*AttemptTrigger) Marshal ¶
func (entity *AttemptTrigger) Marshal() ([]byte, error)
func (*AttemptTrigger) String ¶
func (entity *AttemptTrigger) String() string
func (*AttemptTrigger) Unmarshal ¶
func (entity *AttemptTrigger) Unmarshal(data []byte) error
type AuditTime ¶
type Endpoint ¶
type Endpoint struct { Entity AuditTime SecretKey string AppId string Name string // HTTP: POST/PUT/PATCH Method string // format: scheme ":" ["//" authority] path ["?" query] ["#" fragment] // HTTP: https:://httpbentity.org/post?app=kanthor.webhook // gRPC: grpc:://app.kanthorlabs.com Uri string }
func (*Endpoint) GenSecretKey ¶
func (entity *Endpoint) GenSecretKey()
type EndpointMessage ¶
type EndpointRule ¶
type EndpointRule struct { Entity AuditTime EpId string Name string Priority int32 // the logic of not-false is true should be used here // to guarantee default all rule will be on include mode Exclusionary bool // examples // - type // - app_id ConditionSource string // examples: // - any:: // - equal::orders.paid // - prefix::orders. ConditionExpression string }
func (*EndpointRule) TableName ¶
func (entity *EndpointRule) TableName() string
func (*EndpointRule) Validate ¶
func (entity *EndpointRule) Validate() error
type Header ¶
type Message ¶
type PagingQuery ¶
func PagingQueryFromGatewayQuery ¶
func PagingQueryFromGatewayQuery(query *gateway.Query) *PagingQuery
func (*PagingQuery) Validate ¶
func (q *PagingQuery) Validate() error
type RecoveryTask ¶
func (*RecoveryTask) Marshal ¶
func (entity *RecoveryTask) Marshal() ([]byte, error)
func (*RecoveryTask) String ¶
func (entity *RecoveryTask) String() string
func (*RecoveryTask) Unmarshal ¶
func (entity *RecoveryTask) Unmarshal(data []byte) error
type Request ¶
type Response ¶
type ScanningQuery ¶
func ScanningQueryFromGatewayQuery ¶
func ScanningQueryFromGatewayQuery(query *gateway.Query, timer timer.Timer) *ScanningQuery
func (*ScanningQuery) Validate ¶
func (q *ScanningQuery) Validate() error
type ScanningResult ¶
type WorkspaceCredentials ¶
type WorkspaceCredentials struct { Entity AuditTime WsId string Name string Hash string ExpiredAt int64 }
func (*WorkspaceCredentials) TableName ¶
func (entity *WorkspaceCredentials) TableName() string
func (*WorkspaceCredentials) Validate ¶
func (entity *WorkspaceCredentials) Validate() error
type WorkspaceSnapshot ¶
type WorkspaceSnapshot struct { Id string Name string Applications map[string]WorkspaceSnapshotApp }
type WorkspaceSnapshotApp ¶
type WorkspaceSnapshotApp struct { Name string Endpoints map[string]WorkspaceSnapshotEp }
type WorkspaceSnapshotEp ¶
type WorkspaceSnapshotEp struct { Name string Method string Uri string Rules map[string]WorkspaceSnapshotEpr }
Click to show internal directories.
Click to hide internal directories.