Documentation ¶
Index ¶
- Variables
- func New(conf *config.Config, logger logging.Logger, ...) patterns.Runnable
- func RegisterAccountRoutes(router gin.IRoutes, service *sdk)
- func RegisterApplicationRoutes(router gin.IRoutes, service *sdk)
- func RegisterEndpointRoutes(router gin.IRoutes, service *sdk)
- func RegisterEndpointRuleRoutes(router gin.IRoutes, service *sdk)
- func RegisterHealthcheck(router gin.IRoutes, service *sdk)
- func RegisterMessageRoutes(router gin.IRoutes, service *sdk)
- func RegisterWorkspaceResolver(uc usecase.Sdk) ...
- func UseAccountGet(service *sdk) gin.HandlerFunc
- func UseApplicationCreate(service *sdk) gin.HandlerFunc
- func UseApplicationDelete(service *sdk) gin.HandlerFunc
- func UseApplicationGet(service *sdk) gin.HandlerFunc
- func UseApplicationList(service *sdk) gin.HandlerFunc
- func UseApplicationUpdate(service *sdk) gin.HandlerFunc
- func UseEndpointCreate(service *sdk) gin.HandlerFunc
- func UseEndpointDelete(service *sdk) gin.HandlerFunc
- func UseEndpointGet(service *sdk) gin.HandlerFunc
- func UseEndpointGetSecret(service *sdk) gin.HandlerFunc
- func UseEndpointList(service *sdk) gin.HandlerFunc
- func UseEndpointRuleCreate(service *sdk) gin.HandlerFunc
- func UseEndpointRuleDelete(service *sdk) gin.HandlerFunc
- func UseEndpointRuleGet(service *sdk) gin.HandlerFunc
- func UseEndpointRuleList(service *sdk) gin.HandlerFunc
- func UseEndpointRuleUpdate(service *sdk) gin.HandlerFunc
- func UseEndpointUpdate(service *sdk) gin.HandlerFunc
- func UseMessageCreate(service *sdk) gin.HandlerFunc
- type Account
- type AccountGetRes
- type Application
- type ApplicationCreateReq
- type ApplicationCreateRes
- type ApplicationDeleteRes
- type ApplicationGetRes
- type ApplicationListRes
- type ApplicationUpdateReq
- type ApplicationUpdateRes
- type Endpoint
- type EndpointCreateReq
- type EndpointCreateRes
- type EndpointDeleteRes
- type EndpointGetRes
- type EndpointGetSecretRes
- type EndpointListRes
- type EndpointRule
- type EndpointRuleCreateReq
- type EndpointRuleCreateRes
- type EndpointRuleDeleteRes
- type EndpointRuleGetRes
- type EndpointRuleListRes
- type EndpointRuleUpdateReq
- type EndpointRuleUpdateRes
- type EndpointUpdateReq
- type EndpointUpdateRes
- type MessageCreateReq
- type MessageCreateRes
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotStarted = errors.New("SERVICE.SDK_API.NOT_STARTED") ErrAlreadyStarted = errors.New("SERVICE.SDK_API.ALREAD_STARTED") )
var AuthzEngineInternal = "sdk.internal"
Functions ¶
func RegisterAccountRoutes ¶
func RegisterEndpointRoutes ¶
func RegisterHealthcheck ¶
func RegisterMessageRoutes ¶
func UseAccountGet ¶
func UseAccountGet(service *sdk) gin.HandlerFunc
UseAccountGet @Tags account @Router /account/me [get] @Success 200 {object} AccountGetRes @Failure default {object} gateway.Err @Security Authorization
func UseApplicationCreate ¶
func UseApplicationCreate(service *sdk) gin.HandlerFunc
UseApplicationCreate @Tags application @Router /application [post] @Param payload body ApplicationCreateReq true "application payload" @Success 201 {object} ApplicationCreateRes @Failure default {object} gateway.Err @Security Authorization @Security WorkspaceId
func UseApplicationDelete ¶
func UseApplicationDelete(service *sdk) gin.HandlerFunc
UseApplicationDelete @Tags application @Router /application/{app_id} [delete] @Param app_id path string true "application id" @Success 200 {object} ApplicationDeleteRes @Failure default {object} gateway.Err @Security Authorization @Security WorkspaceId
func UseApplicationGet ¶
func UseApplicationGet(service *sdk) gin.HandlerFunc
UseApplicationGet @Tags application @Router /application/{app_id} [get] @Param app_id path string true "application id" @Success 200 {object} ApplicationGetRes @Failure default {object} gateway.Err @Security Authorization @Security WorkspaceId
func UseApplicationList ¶
func UseApplicationList(service *sdk) gin.HandlerFunc
UseApplicationList @Tags application @Router /application [get] @Param id query []string false "list by ids" @Param _q query string false "search keyword" @Param _limit query int false "limit returning records" default(10) @Param _page query int false "current requesting page" default(0) @Success 200 {object} ApplicationListRes @Failure default {object} gateway.Err @Security Authorization @Security WorkspaceId
func UseApplicationUpdate ¶
func UseApplicationUpdate(service *sdk) gin.HandlerFunc
UseApplicationUpdate @Tags application @Router /application/{app_id} [patch] @Param app_id path string true "application id" @Param payload body ApplicationUpdateReq true "application payload" @Success 200 {object} ApplicationUpdateRes @Failure default {object} gateway.Err @Security Authorization @Security WorkspaceId
func UseEndpointCreate ¶
func UseEndpointCreate(service *sdk) gin.HandlerFunc
UseEndpointCreate @Tags endpoint @Router /endpoint [post] @Param payload body EndpointCreateReq true "endpoint payload" @Success 201 {object} EndpointCreateRes @Failure default {object} gateway.Err @Security Authorization @Security WorkspaceId
func UseEndpointDelete ¶
func UseEndpointDelete(service *sdk) gin.HandlerFunc
UseEndpointDelete @Tags endpoint @Router /endpoint/{ep_id} [delete] @Param ep_id path string true "endpoint id" @Success 200 {object} EndpointDeleteRes @Failure default {object} gateway.Err @Security Authorization @Security WorkspaceId
func UseEndpointGet ¶
func UseEndpointGet(service *sdk) gin.HandlerFunc
UseEndpointGet @Tags endpoint @Router /endpoint/{ep_id} [get] @Param ep_id path string true "endpoint id" @Success 200 {object} EndpointGetRes @Failure default {object} gateway.Err @Security Authorization @Security WorkspaceId
func UseEndpointGetSecret ¶
func UseEndpointGetSecret(service *sdk) gin.HandlerFunc
UseEndpointGetSecret @Tags endpoint @Router /endpoint/{ep_id}/secret [get] @Param ep_id path string true "endpoint id" @Success 200 {object} EndpointGetSecretRes @Failure default {object} gateway.Err @Security Authorization @Security WorkspaceId
func UseEndpointList ¶
func UseEndpointList(service *sdk) gin.HandlerFunc
UseEndpointList @Tags endpoint @Router /endpoint [get] @Param app_id query string false "application id" @Param id query []string false "list by ids" @Param _q query string false "search keyword" @Param _limit query int false "limit returning records" default(10) @Param _page query int false "current requesting page" default(0) @Success 200 {object} EndpointListRes @Failure default {object} gateway.Err @Security Authorization @Security WorkspaceId
func UseEndpointRuleCreate ¶
func UseEndpointRuleCreate(service *sdk) gin.HandlerFunc
UseEndpointRuleCreate @Tags endpoint rule @Router /rule [post] @Param payload body EndpointRuleCreateReq true "rule payload" @Success 201 {object} EndpointRuleCreateRes @Failure default {object} gateway.Err @Security Authorization @Security WorkspaceId
func UseEndpointRuleDelete ¶
func UseEndpointRuleDelete(service *sdk) gin.HandlerFunc
UseEndpointRuleDelete @Tags endpoint rule @Router /rule/{epr_id} [delete] @Param epr_id path string true "rule id" @Success 200 {object} EndpointRuleDeleteRes @Failure default {object} gateway.Err @Security Authorization @Security WorkspaceId
func UseEndpointRuleGet ¶
func UseEndpointRuleGet(service *sdk) gin.HandlerFunc
UseEndpointRuleGet @Tags endpoint rule @Router /rule/{epr_id} [get] @Param epr_id path string true "rule id" @Success 200 {object} EndpointRuleGetRes @Failure default {object} gateway.Err @Security Authorization @Security WorkspaceId
func UseEndpointRuleList ¶
func UseEndpointRuleList(service *sdk) gin.HandlerFunc
UseEndpointRuleList @Tags endpoint rule @Router /rule [get] @Param app_id query string false "application id" @Param ep_id query string false "endpoint id" @Param id query []string false "list by ids" @Param _q query string false "search keyword" @Param _limit query int false "limit returning records" default(10) @Param _page query int false "current requesting page" default(0) @Success 200 {object} EndpointRuleListRes @Failure default {object} gateway.Err @Security Authorization @Security WorkspaceId
func UseEndpointRuleUpdate ¶
func UseEndpointRuleUpdate(service *sdk) gin.HandlerFunc
UseEndpointRuleUpdate @Tags endpoint rule @Router /rule/{epr_id} [patch] @Param epr_id path string true "rule id" @Param payload body EndpointRuleUpdateReq true "rule payload" @Success 200 {object} EndpointRuleUpdateRes @Failure default {object} gateway.Err @Security Authorization @Security WorkspaceId
func UseEndpointUpdate ¶
func UseEndpointUpdate(service *sdk) gin.HandlerFunc
UseEndpointUpdate @Tags endpoint @Router /endpoint/{ep_id} [patch] @Param ep_id path string true "endpoint id" @Param payload body EndpointUpdateReq true "endpoint payload" @Success 200 {object} EndpointUpdateRes @Failure default {object} gateway.Err @Security Authorization @Security WorkspaceId
func UseMessageCreate ¶
func UseMessageCreate(service *sdk) gin.HandlerFunc
UseMessageCreate @Tags message @Router /message [post] @Param payload body MessageCreateReq true "message payload" @Success 201 {object} MessageCreateRes @Failure default {object} gateway.Err @Security Authorization @Security WorkspaceId
Types ¶
type Account ¶
type Account struct { Sub string `json:"sub"` Name string `json:"name"` Metadata map[string]string `json:"metadata"` } // @name Account
func ToAccount ¶
func ToAccount(acc *authenticator.Account) *Account
type AccountGetRes ¶
type AccountGetRes struct { Account *Account `json:"account"` } // @name AccountGetRes
type Application ¶
type Application struct { Id string `json:"id"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` WsId string `json:"ws_id"` Name string `json:"name"` } // @name Application
func ToApplication ¶
func ToApplication(doc *entities.Application) *Application
type ApplicationCreateReq ¶
type ApplicationCreateReq struct { Name string `json:"name" default:"openapi"` } // @name ApplicationCreateReq
type ApplicationCreateRes ¶
type ApplicationCreateRes struct { *Application } // @name ApplicationCreateRes
type ApplicationDeleteRes ¶
type ApplicationDeleteRes struct { *Application } // @name ApplicationDeleteRes
type ApplicationGetRes ¶
type ApplicationGetRes struct { *Application } // @name ApplicationGetRes
type ApplicationListRes ¶
type ApplicationListRes struct { Data []Application `json:"data"` Count int64 `json:"count"` } // @name ApplicationListRes
type ApplicationUpdateReq ¶
type ApplicationUpdateReq struct { Name string `json:"name"` } // @name ApplicationUpdateReq
type ApplicationUpdateRes ¶
type ApplicationUpdateRes struct { *Application } // @name ApplicationUpdateRes
type Endpoint ¶
type Endpoint struct { Id string `json:"id"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` AppId string `json:"app_id"` Name string `json:"name"` Method string `json:"method"` Uri string `json:"uri"` } // @name Endpoint
func ToEndpoint ¶
type EndpointCreateReq ¶
type EndpointCreateRes ¶
type EndpointCreateRes struct { *Endpoint // To make the UI become friendly we will return the secret key after user create the new endpoint // but we don't want to return that key everytime user request for the endpoint // user must have specific permission to reveal the secret key of an endpoint SecretKey string `json:"secret_key"` } // @name EndpointCreateRes
type EndpointDeleteRes ¶
type EndpointDeleteRes struct { *Endpoint } // @name EndpointDeleteRes
type EndpointGetRes ¶
type EndpointGetRes struct { *Endpoint } // @name EndpointGetRes
type EndpointGetSecretRes ¶
type EndpointGetSecretRes struct { SecretKey string `json:"secret_key"` } // @name EndpointGetSecretRes
type EndpointListRes ¶
type EndpointRule ¶
type EndpointRule struct { Id string `json:"id"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` EpId string `json:"ep_id"` Name string `json:"name"` Priority int32 `json:"priority"` Exclusionary bool `json:"exclusionary"` ConditionSource string `json:"condition_source"` ConditionExpression string `json:"condition_expression"` } // @name EndpointRule
func ToEndpointRule ¶
func ToEndpointRule(doc *entities.EndpointRule) *EndpointRule
type EndpointRuleCreateReq ¶
type EndpointRuleCreateReq struct { EpId string `json:"ep_id"` Name string `json:"name" default:"passthrough"` Priority int32 `json:"priority" default:"100"` Exclusionary bool `json:"exclusionary" default:"false"` ConditionSource string `json:"condition_source" default:"type"` ConditionExpression string `json:"condition_expression" default:"any::"` } // @name EndpointRuleCreateReq
type EndpointRuleCreateRes ¶
type EndpointRuleCreateRes struct { *EndpointRule } // @name EndpointRuleCreateRes
type EndpointRuleDeleteRes ¶
type EndpointRuleDeleteRes struct { *EndpointRule } // @name EndpointRuleDeleteRes
type EndpointRuleGetRes ¶
type EndpointRuleGetRes struct { *EndpointRule } // @name EndpointRuleGetRes
type EndpointRuleListRes ¶
type EndpointRuleListRes struct { Data []EndpointRule `json:"data"` Count int64 `json:"count"` } // @name EndpointRuleListRes
type EndpointRuleUpdateReq ¶
type EndpointRuleUpdateRes ¶
type EndpointRuleUpdateRes struct { *EndpointRule } // @name EndpointRuleUpdateRes
type EndpointUpdateReq ¶
type EndpointUpdateRes ¶
type EndpointUpdateRes struct { *Endpoint } // @name EndpointUpdateRes
type MessageCreateReq ¶
type MessageCreateRes ¶
type MessageCreateRes struct { Id string `json:"id"` } // @name MessageCreateRes
Source Files ¶
- account.go
- account_get.go
- application.go
- application_create.go
- application_delete.go
- application_get.go
- application_list.go
- application_update.go
- endpoint.go
- endpoint_create.go
- endpoint_delete.go
- endpoint_get.go
- endpoint_get_secret.go
- endpoint_list.go
- endpoint_rule.go
- endpoint_rule_create.go
- endpoint_rule_delete.go
- endpoint_rule_get.go
- endpoint_rule_list.go
- endpoint_rule_update.go
- endpoint_update.go
- entrypoint.go
- entrypoint_authenticate.go
- entrypoint_healthcheck.go
- entrypoint_swagger.go
- entrypoint_transformation.go
- errors.go
- message.go
- message_create.go