Documentation
¶
Index ¶
- type Approval
- type ApprovalApproveRequest
- type ApprovalApproveResponse
- type ApprovalDetail
- type ApprovalGetRequest
- type ApprovalGetResponse
- type ApprovalRejectRequest
- type ApprovalRejectResponse
- type ApprovalSummary
- type ApprovalsListRequest
- type ApprovalsListResponse
- type Handler
- type Service
- func (s *Service) Approve(ctx context.Context, req *ApprovalApproveRequest) (*ApprovalApproveResponse, error)
- func (s *Service) Get(ctx context.Context, req *ApprovalGetRequest) (*ApprovalGetResponse, error)
- func (s *Service) List(ctx context.Context, req *ApprovalsListRequest) (*ApprovalsListResponse, error)
- func (s *Service) Reject(ctx context.Context, req *ApprovalRejectRequest) (*ApprovalRejectResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Approval ¶
type Approval struct {
ID string `json:"id"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
Actor string `json:"actor"`
FunctionID string `json:"function_id"`
GameID string `json:"game_id"`
Env string `json:"env"`
State string `json:"state"`
Mode string `json:"mode"`
Route string `json:"route,omitempty"`
IdempotencyKey string `json:"idempotency_key,omitempty"`
TargetServiceID string `json:"target_service_id,omitempty"`
HashKey string `json:"hash_key,omitempty"`
Reason string `json:"reason,omitempty"`
Payload map[string]interface{} `json:"payload,omitempty"`
PayloadPreview string `json:"payload_preview,omitempty"`
}
Approval represents an approval (for response)
type ApprovalApproveRequest ¶
type ApprovalApproveRequest struct {
ID string `uri:"id"`
}
ApprovalApproveRequest represents the request to approve an approval
type ApprovalApproveResponse ¶
ApprovalApproveResponse represents the response after approving
type ApprovalDetail ¶
type ApprovalDetail struct {
ApprovalSummary
Payload map[string]interface{} `json:"payload,omitempty"`
PayloadPreview string `json:"payload_preview,omitempty"`
}
ApprovalDetail represents an approval detail
type ApprovalGetRequest ¶
type ApprovalGetRequest struct {
ID string `uri:"id"`
}
ApprovalGetRequest represents the request to get approval details
type ApprovalGetResponse ¶
type ApprovalGetResponse struct {
Approval
}
ApprovalGetResponse represents the response with approval details
type ApprovalRejectRequest ¶
ApprovalRejectRequest represents the request to reject an approval
type ApprovalRejectResponse ¶
type ApprovalRejectResponse struct {
ID string `json:"id"`
State string `json:"state"`
Reason string `json:"reason"`
}
ApprovalRejectResponse represents the response after rejecting
type ApprovalSummary ¶
type ApprovalSummary struct {
ID string `json:"id"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
Actor string `json:"actor"`
FunctionID string `json:"function_id"`
GameID string `json:"game_id"`
Env string `json:"env"`
State string `json:"state"`
Mode string `json:"mode"`
Route string `json:"route,omitempty"`
IdempotencyKey string `json:"idempotency_key,omitempty"`
TargetServiceID string `json:"target_service_id,omitempty"`
HashKey string `json:"hash_key,omitempty"`
Reason string `json:"reason,omitempty"`
}
ApprovalSummary represents an approval summary
type ApprovalsListRequest ¶
type ApprovalsListRequest struct {
Page int `form:"page,optional,default=1"`
PageSize int `form:"pageSize,optional,default=20"`
Status string `form:"status"`
}
ApprovalsListRequest represents the request to list approvals
type ApprovalsListResponse ¶
type ApprovalsListResponse struct {
Approvals []ApprovalSummary `json:"approvals"`
Total int64 `json:"total"`
Page int `json:"page"`
Size int `json:"size"`
}
ApprovalsListResponse represents the response with a list of approvals
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(svcCtx *svc.ServiceContext) *Service
func (*Service) Approve ¶
func (s *Service) Approve(ctx context.Context, req *ApprovalApproveRequest) (*ApprovalApproveResponse, error)
Approve approves an approval
func (*Service) Get ¶
func (s *Service) Get(ctx context.Context, req *ApprovalGetRequest) (*ApprovalGetResponse, error)
Get retrieves details of a specific approval
func (*Service) List ¶
func (s *Service) List(ctx context.Context, req *ApprovalsListRequest) (*ApprovalsListResponse, error)
List retrieves a paginated list of approvals
func (*Service) Reject ¶
func (s *Service) Reject(ctx context.Context, req *ApprovalRejectRequest) (*ApprovalRejectResponse, error)
Reject rejects an approval