Documentation ¶
Index ¶
- Variables
- func FromWorkspaceSnapshot(snapshot *WorkspaceSnapshot, id string) *entities.WorkspaceSnapshot
- func New(conf *config.Config, logger logging.Logger, ...) patterns.Runnable
- func RegisterAccountRoutes(router gin.IRoutes, service *portal)
- func RegisterAnalyticsRoutes(router gin.IRoutes, service *portal)
- func RegisterApplicationRoutes(router gin.IRoutes, service *portal)
- func RegisterEndpointRoutes(router gin.IRoutes, service *portal)
- func RegisterHealthcheck(router gin.IRoutes, service *portal)
- func RegisterWorkspaceCredentialsRoutes(router gin.IRoutes, service *portal)
- func RegisterWorkspaceResolver(uc usecase.Portal) ...
- func RegisterWorkspaceRoutes(router gin.IRoutes, service *portal)
- func UseAccountGet(service *portal) gin.HandlerFunc
- func UseAnalyticsGetOverview(service *portal) gin.HandlerFunc
- func UseApplicationGetMessage(service *portal) gin.HandlerFunc
- func UseApplicationListMessage(service *portal) gin.HandlerFunc
- func UseEndpointGetMessage(service *portal) gin.HandlerFunc
- func UseEndpointListMessage(service *portal) gin.HandlerFunc
- func UseWorkspaceCreate(service *portal) gin.HandlerFunc
- func UseWorkspaceCredentialsCreate(service *portal) gin.HandlerFunc
- func UseWorkspaceCredentialsExpire(service *portal) gin.HandlerFunc
- func UseWorkspaceCredentialsGet(service *portal) gin.HandlerFunc
- func UseWorkspaceCredentialsList(service *portal) gin.HandlerFunc
- func UseWorkspaceCredentialsUpdate(service *portal) gin.HandlerFunc
- func UseWorkspaceExport(service *portal) gin.HandlerFunc
- func UseWorkspaceGet(service *portal) gin.HandlerFunc
- func UseWorkspaceImport(service *portal) gin.HandlerFunc
- func UseWorkspaceList(service *portal) gin.HandlerFunc
- func UseWorkspaceUpdate(service *portal) gin.HandlerFunc
- type AccountGetRes
- type AnalyticsGetOverviewRes
- type ApplicationGetMessageRes
- type ApplicationListMessageRes
- type EndpointGetMessageRes
- type EndpointListMessageRes
- type EndpointMessage
- type Message
- type Request
- type Response
- type Workspace
- type WorkspaceCreateReq
- type WorkspaceCreateRes
- type WorkspaceCredentials
- type WorkspaceCredentialsCreateReq
- type WorkspaceCredentialsCreateRes
- type WorkspaceCredentialsExpireReq
- type WorkspaceCredentialsExpireRes
- type WorkspaceCredentialsGetRes
- type WorkspaceCredentialsListRes
- type WorkspaceCredentialsUpdateReq
- type WorkspaceCredentialsUpdateRes
- type WorkspaceExportRes
- type WorkspaceGetRes
- type WorkspaceImportReq
- type WorkspaceImportRes
- type WorkspaceListRes
- type WorkspaceSnapshot
- type WorkspaceSnapshotApp
- type WorkspaceSnapshotEp
- type WorkspaceSnapshotEpr
- type WorkspaceUpdateReq
- type WorkspaceUpdateRes
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotStarted = errors.New("SERVICE.PORTAL_API.NOT_STARTED") ErrAlreadyStarted = errors.New("SERVICE.PORTAL_API.ALREAD_STARTED") )
Functions ¶
func FromWorkspaceSnapshot ¶
func FromWorkspaceSnapshot(snapshot *WorkspaceSnapshot, id string) *entities.WorkspaceSnapshot
func RegisterAccountRoutes ¶
func RegisterAnalyticsRoutes ¶
func RegisterEndpointRoutes ¶
func RegisterHealthcheck ¶
func RegisterWorkspaceRoutes ¶
func UseAccountGet ¶
func UseAccountGet(service *portal) gin.HandlerFunc
UseAccountGet @Tags account @Router /account [get] @Success 200 {object} AccountGetRes @Failure default {object} gateway.Err @Security Authorization @Security WorkspaceId
func UseAnalyticsGetOverview ¶
func UseAnalyticsGetOverview(service *portal) gin.HandlerFunc
UseAnalyticsGetOverview @Tags analytics @Router /analytics/overview [get] @Success 200 {object} AnalyticsGetOverviewRes @Failure default {object} gateway.Err @Security Authorization @Security WorkspaceId
func UseApplicationGetMessage ¶
func UseApplicationGetMessage(service *portal) gin.HandlerFunc
UseApplicationGetMessage @Tags application @Router /application/{app_id}/message/{msg_id} [get] @Success 200 {object} ApplicationGetMessageRes @Failure default {object} gateway.Err @Security Authorization @Security WorkspaceId
func UseApplicationListMessage ¶
func UseApplicationListMessage(service *portal) gin.HandlerFunc
UseApplicationListMessage @Tags application @Router /application/{app_id}/message [get] @Param _limit query int false "limit returning records" default(10) @Param _start query int64 false "starting time to scan in milliseconds" example(1669914060000) @Param _end query int64 false "ending time to scan in milliseconds" example(1985533260000) @Success 200 {object} ApplicationListMessageRes @Failure default {object} gateway.Err @Security Authorization @Security WorkspaceId
func UseEndpointGetMessage ¶
func UseEndpointGetMessage(service *portal) gin.HandlerFunc
UseEndpointGetMessage @Tags endpoint @Router /endpoint/{ep_id}/message/{msg_id} [get] @Success 200 {object} EndpointGetMessageRes @Failure default {object} gateway.Err @Security Authorization @Security WorkspaceId
func UseEndpointListMessage ¶
func UseEndpointListMessage(service *portal) gin.HandlerFunc
UseEndpointListMessage @Tags endpoint @Router /endpoint/{ep_id}/message [get] @Param _limit query int false "limit returning records" default(10) @Param _start query int64 false "starting time to scan in milliseconds" example(1669914060000) @Param _end query int64 false "ending time to scan in milliseconds" example(1985533260000) @Success 200 {object} EndpointListMessageRes @Failure default {object} gateway.Err @Security Authorization @Security WorkspaceId
func UseWorkspaceCreate ¶
func UseWorkspaceCreate(service *portal) gin.HandlerFunc
UseWorkspaceCreate @Tags workspace @Router /workspace [post] @Param payload body WorkspaceCreateReq true "workspace payload" @Success 200 {object} WorkspaceCreateRes @Failure default {object} gateway.Err @Security Authorization
func UseWorkspaceCredentialsCreate ¶
func UseWorkspaceCredentialsCreate(service *portal) gin.HandlerFunc
UseWorkspaceCredentialsCreate @Tags credentials @Router /credentials [post] @Param payload body WorkspaceCredentialsCreateReq true "credentials payload" @Success 200 {object} WorkspaceCredentialsCreateRes @Failure default {object} gateway.Err @Security Authorization @Security WorkspaceId
func UseWorkspaceCredentialsExpire ¶
func UseWorkspaceCredentialsExpire(service *portal) gin.HandlerFunc
UseWorkspaceCredentialsExpire @Tags credentials @Router /credentials/{wsc_id}/expiration [put] @Param wsc_id path string true "credentials id" @Param payload body WorkspaceCredentialsExpireReq true "credentials payload" @Success 200 {object} WorkspaceCredentialsExpireRes @Failure default {object} gateway.Err @Security Authorization @Security WorkspaceId
func UseWorkspaceCredentialsGet ¶
func UseWorkspaceCredentialsGet(service *portal) gin.HandlerFunc
UseWorkspaceCredentialsGet @Tags credentials @Router /credentials/{wsc_id} [get] @Param wsc_id path string true "credentials id" @Success 200 {object} WorkspaceCredentialsGetRes @Failure default {object} gateway.Err @Security Authorization @Security WorkspaceId
func UseWorkspaceCredentialsList ¶
func UseWorkspaceCredentialsList(service *portal) gin.HandlerFunc
UseWorkspaceCredentialsList @Tags credentials @Router /credentials [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 "requesting page" default(0) @Success 200 {object} WorkspaceCredentialsListRes @Failure default {object} gateway.Err @Security Authorization @Security WorkspaceId
func UseWorkspaceCredentialsUpdate ¶
func UseWorkspaceCredentialsUpdate(service *portal) gin.HandlerFunc
UseWorkspaceCredentialsUpdate @Tags credentials @Router /credentials/{wsc_id} [patch] @Param wsc_id path string true "credentials id" @Param payload body WorkspaceCredentialsUpdateReq true "credentials payload" @Success 200 {object} WorkspaceCredentialsUpdateRes @Failure default {object} gateway.Err @Security Authorization @Security WorkspaceId
func UseWorkspaceExport ¶
func UseWorkspaceExport(service *portal) gin.HandlerFunc
UseWorkspaceExport @Tags workspace @Router /workspace/{ws_id}/transfer [get] @Param ws_id path string true "workspace id" @Success 200 {object} WorkspaceExportRes @Failure default {object} gateway.Err @Security Authorization
func UseWorkspaceGet ¶
func UseWorkspaceGet(service *portal) gin.HandlerFunc
UseWorkspaceGet @Tags workspace @Router /workspace/{ws_id} [get] @Param ws_id path string true "workspace id" @Success 200 {object} WorkspaceGetRes @Failure default {object} gateway.Err @Security Authorization
func UseWorkspaceImport ¶
func UseWorkspaceImport(service *portal) gin.HandlerFunc
UseWorkspaceImport @Tags workspace @Router /workspace/{ws_id}/transfer [post] @Param ws_id path string true "workspace id" @Param payload body WorkspaceImportReq true "import payload" @Success 200 {object} WorkspaceImportRes @Failure default {object} gateway.Err @Security Authorization
func UseWorkspaceList ¶
func UseWorkspaceList(service *portal) gin.HandlerFunc
UseWorkspaceList @Tags workspace @Router /workspace [get] @Success 200 {object} WorkspaceGetRes @Failure default {object} gateway.Err @Security Authorization
func UseWorkspaceUpdate ¶
func UseWorkspaceUpdate(service *portal) gin.HandlerFunc
UseWorkspaceUpdate @Tags workspace @Router /workspace/{ws_id} [patch] @Param ws_id path string true "workspace id" @Param payload body WorkspaceUpdateReq true "workspace payload" @Success 200 {object} WorkspaceUpdateRes @Failure default {object} gateway.Err @Security Authorization
Types ¶
type AccountGetRes ¶
type AccountGetRes struct { Account *authenticator.Account `json:"account"` Workspaces []Workspace `json:"workspaces"` } // @name AccountGetRes
type AnalyticsGetOverviewRes ¶
type ApplicationGetMessageRes ¶
type ApplicationGetMessageRes struct { *Message } // @name ApplicationGetMessageRes
type ApplicationListMessageRes ¶
type ApplicationListMessageRes struct { Data []Message `json:"data"` } // @name ApplicationListMessageRes
type EndpointGetMessageRes ¶
type EndpointGetMessageRes struct { *EndpointMessage } // @name EndpointGetMessageRes
type EndpointListMessageRes ¶
type EndpointListMessageRes struct { Data []EndpointMessage `json:"data"` } // @name EndpointListMessageRes
type EndpointMessage ¶
type EndpointMessage struct { *Message RequestCount int `json:"request_count"` RequestLatestTs int64 `json:"request_latest_ts"` ResponseCount int `json:"response_count"` ResponseLatestTs int64 `json:"response_latest_ts"` SuccessId string `json:"success_id"` Requests []Request `json:"requests"` Responses []Response `json:"responses"` } // @name EndpointMessage
func ToEndpointMessage ¶
func ToEndpointMessage(doc *entities.EndpointMessage, requests []entities.Request, responses []entities.Response) *EndpointMessage
type Message ¶
type Request ¶
type Request struct { Id string `json:"id"` Timestamp int64 `json:"timestamp"` EpId string `json:"ep_id"` MsgId string `json:"msg_id"` AppId string `json:"app_id"` Type string `json:"type"` Metadata string `json:"metadata"` Headers string `json:"headers"` Body string `json:"body"` Uri string `json:"uri"` Method string `json:"method"` } // @name Request
type Response ¶
type Response struct { Id string `json:"id"` Timestamp int64 `json:"timestamp"` EpId string `json:"ep_id"` MsgId string `json:"msg_id"` ReqId string `json:"req_id"` AppId string `json:"app_id"` Type string `json:"type"` Metadata string `json:"metadata"` Headers string `json:"headers"` Body string `json:"body"` Uri string `json:"uri"` Status int `json:"status"` Error string `json:"error"` } // @name Response
type Workspace ¶
type Workspace struct { Id string `json:"id"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` OwnerId string `json:"owner_id"` Name string `json:"name"` Tier string `json:"tier"` } // @name Workspace
func ToWorkspace ¶
type WorkspaceCreateReq ¶
type WorkspaceCreateReq struct { Name string `json:"name" default:"main"` } // @name WorkspaceCreateReq
type WorkspaceCreateRes ¶
type WorkspaceCreateRes struct { *Workspace } // @name WorkspaceCreateRes
type WorkspaceCredentials ¶
type WorkspaceCredentials struct { Id string `json:"id"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` WsId string `json:"ws_id"` Name string `json:"name"` ExpiredAt int64 `json:"expired_at"` } // @name WorkspaceCredentials
func ToWorkspaceCredentials ¶
func ToWorkspaceCredentials(doc *entities.WorkspaceCredentials) *WorkspaceCredentials
type WorkspaceCredentialsExpireReq ¶
type WorkspaceCredentialsExpireReq struct { Duration int64 `json:"duration" default:"1800000"` } // @name WorkspaceCredentialsExpireReq
type WorkspaceCredentialsGetRes ¶
type WorkspaceCredentialsGetRes struct { *WorkspaceCredentials } // @name WorkspaceCredentialsGetRes
type WorkspaceCredentialsListRes ¶
type WorkspaceCredentialsListRes struct { Data []WorkspaceCredentials `json:"data"` Count int64 `json:"count"` } // @name WorkspaceCredentialsListRes
type WorkspaceCredentialsUpdateRes ¶
type WorkspaceCredentialsUpdateRes struct { *WorkspaceCredentials } // @name WorkspaceCredentialsUpdateRes
type WorkspaceExportRes ¶
type WorkspaceExportRes struct { *WorkspaceSnapshot } // @name WorkspaceExportRes
type WorkspaceGetRes ¶
type WorkspaceGetRes struct { *Workspace } // @name WorkspaceGetRes
type WorkspaceImportReq ¶
type WorkspaceImportReq struct { Snapshot *WorkspaceSnapshot `json:"snapshot" form:"snapshot" binding:"required"` } // @name WorkspaceImportReq
type WorkspaceImportRes ¶
type WorkspaceListRes ¶
type WorkspaceSnapshot ¶
type WorkspaceSnapshot struct { Name string `json:"name"` Applications []WorkspaceSnapshotApp `json:"applications"` } // @name WorkspaceSnapshot
func ToWorkspaceSnapshot ¶
func ToWorkspaceSnapshot(snapshot *entities.WorkspaceSnapshot) *WorkspaceSnapshot
type WorkspaceSnapshotApp ¶
type WorkspaceSnapshotApp struct { Name string `json:"name"` Endpoints []WorkspaceSnapshotEp `json:"endpoints"` } // @name WorkspaceSnapshotApp
type WorkspaceSnapshotEp ¶
type WorkspaceSnapshotEp struct { Name string `json:"name"` Method string `json:"method"` Uri string `json:"uri"` Rules []WorkspaceSnapshotEpr `json:"rules"` } // @name WorkspaceSnapshotEp
type WorkspaceSnapshotEpr ¶
type WorkspaceUpdateReq ¶
type WorkspaceUpdateReq struct { Name string `json:"name" example:"another name"` } // @name WorkspaceUpdateReq
type WorkspaceUpdateRes ¶
type WorkspaceUpdateRes struct { *Workspace } // @name WorkspaceUpdateRes
Source Files ¶
- account.go
- account_get.go
- analytics.go
- analytics_get_overview.go
- application.go
- application_get_message.go
- application_list_message.go
- endpoint.go
- endpoint_get_message.go
- endpoint_list_message.go
- entrypoint.go
- entrypoint_authenticate.go
- entrypoint_healthcheck.go
- entrypoint_swagger.go
- entrypoint_transformation.go
- errors.go
- workspace.go
- workspace_create.go
- workspace_credentials.go
- workspace_credentials_create.go
- workspace_credentials_expire.go
- workspace_credentials_get.go
- workspace_credentials_list.go
- workspace_credentials_update.go
- workspace_export.go
- workspace_get.go
- workspace_import.go
- workspace_list.go
- workspace_update.go