Documentation
¶
Index ¶
- Constants
- func GetStatusCodeFromError(err error) (int, bool)
- func IsAPIError(err error) bool
- type FndsClient
- func (c *FndsClient) CreateEvent(ctx context.Context, eventData fndstypes.StageTransitionEvent) error
- func (c *FndsClient) CreateEventV2(ctx context.Context, eventData fndstypes.DeploymentStageTransitionEvent) error
- func (c *FndsClient) DeleteFunctionVersionEvents(ctx context.Context, functionVersionId uuid.UUID) error
- func (c *FndsClient) DeleteFunctionVersionEventsV2(ctx context.Context, functionVersionId uuid.UUID, deploymentId uuid.UUID) error
- func (c *FndsClient) DeleteInstanceEvents(ctx context.Context, functionVersionId uuid.UUID, instanceId string) error
- func (c *FndsClient) DeleteInstanceEventsV2(ctx context.Context, functionVersionId uuid.UUID, deploymentId uuid.UUID, ...) error
- func (c *FndsClient) GetEventByEventType(ctx context.Context, functionVersionId uuid.UUID, instanceId string, ...) (fndstypes.StageTransitionEvent, error)
- func (c *FndsClient) GetEventByEventTypeV2(ctx context.Context, functionVersionId uuid.UUID, deploymentId uuid.UUID, ...) (fndstypes.DeploymentStageTransitionEvent, error)
- func (c *FndsClient) GetEvents(ctx context.Context, functionVersionId uuid.UUID, instanceId string) ([]fndstypes.StageTransitionEvent, error)
- func (c *FndsClient) GetEventsV2(ctx context.Context, functionVersionId uuid.UUID, deploymentId uuid.UUID, ...) ([]fndstypes.DeploymentStageTransitionEvent, error)
- func (c *FndsClient) GetNcaId() string
- func (c *FndsClient) GetStats(ctx context.Context, functionVersionId uuid.UUID) (fndstypes.DeploymentStats, error)
- func (c *FndsClient) GetStatsV2(ctx context.Context, functionVersionId uuid.UUID, deploymentId uuid.UUID) (fndstypes.DeploymentStats, error)
- func (c *FndsClient) ListInstances(ctx context.Context, functionVersionId uuid.UUID) ([]fndstypes.Instance, error)
- func (c *FndsClient) ListInstancesV2(ctx context.Context, functionVersionId uuid.UUID, deploymentId uuid.UUID) ([]fndstypes.Instance, error)
- func (c *FndsClient) NewDeploymentStageTransitionEvent(ncaId string, functionId uuid.UUID, functionVersionId uuid.UUID, ...) (fndstypes.DeploymentStageTransitionEvent, error)
- func (c *FndsClient) NewStageTransitionEvent(ncaId string, functionId uuid.UUID, functionVersionId uuid.UUID, ...) (fndstypes.StageTransitionEvent, error)
- type FndsClientOption
- type LedgerClient
- type SimpleAPIError
- type TokenFetcher
Constants ¶
View Source
const ( ListInstancesEndpointV1 = "/v1/ledger/versions/%s/instances" CreateEventEndpointV1 = "/v1/ledger/versions/%s/instances/%s" GetEventsEndpointV1 = "/v1/ledger/versions/%s/instances/%s" GetEventByEventTypeEndpointV1 = "/v1/ledger/versions/%s/instances/%s/events/%s" DeleteInstanceEventsEndpointV1 = "/v1/ledger/versions/%s/instances/%s" DeleteFunctionVersionEventsEndpointV1 = "/v1/ledger/versions/%s/instances" GetStatsEndpointV1 = "/v1/ledger/versions/%s/stats" ListInstancesEndpointV2 = "/v2/ledger/versions/%s/deployments/%s/instances" CreateEventEndpointV2 = "/v2/ledger/versions/%s/deployments/%s/instances/%s" GetEventsEndpointV2 = "/v2/ledger/versions/%s/deployments/%s/instances/%s" GetEventByEventTypeEndpointV2 = "/v2/ledger/versions/%s/deployments/%s/instances/%s/events/%s" DeleteInstanceEventsEndpointV2 = "/v2/ledger/versions/%s/deployments/%s/instances/%s" DeleteFunctionVersionEventsEndpointV2 = "/v2/ledger/versions/%s/deployments/%s/instances" GetStatsEndpointV2 = "/v2/ledger/versions/%s/deployments/%s/stats" )
Variables ¶
This section is empty.
Functions ¶
func GetStatusCodeFromError ¶
GetStatusCodeFromError extracts the HTTP status code from an API error if possible
Types ¶
type FndsClient ¶
func NewFndsClient ¶
func NewFndsClient(endpoint string, ncaId string, tokenFetcher TokenFetcher, opts ...FndsClientOption) *FndsClient
func (*FndsClient) CreateEvent ¶
func (c *FndsClient) CreateEvent(ctx context.Context, eventData fndstypes.StageTransitionEvent) error
func (*FndsClient) CreateEventV2 ¶
func (c *FndsClient) CreateEventV2(ctx context.Context, eventData fndstypes.DeploymentStageTransitionEvent) error
func (*FndsClient) DeleteFunctionVersionEvents ¶
func (*FndsClient) DeleteFunctionVersionEventsV2 ¶
func (*FndsClient) DeleteInstanceEvents ¶
func (*FndsClient) DeleteInstanceEventsV2 ¶
func (*FndsClient) GetEventByEventType ¶
func (c *FndsClient) GetEventByEventType(ctx context.Context, functionVersionId uuid.UUID, instanceId string, eventType string) (fndstypes.StageTransitionEvent, error)
func (*FndsClient) GetEventByEventTypeV2 ¶
func (*FndsClient) GetEvents ¶
func (c *FndsClient) GetEvents(ctx context.Context, functionVersionId uuid.UUID, instanceId string) ([]fndstypes.StageTransitionEvent, error)
func (*FndsClient) GetEventsV2 ¶
func (*FndsClient) GetNcaId ¶
func (c *FndsClient) GetNcaId() string
func (*FndsClient) GetStats ¶
func (c *FndsClient) GetStats(ctx context.Context, functionVersionId uuid.UUID) (fndstypes.DeploymentStats, error)
func (*FndsClient) GetStatsV2 ¶
func (c *FndsClient) GetStatsV2(ctx context.Context, functionVersionId uuid.UUID, deploymentId uuid.UUID) (fndstypes.DeploymentStats, error)
func (*FndsClient) ListInstances ¶
func (*FndsClient) ListInstancesV2 ¶
func (*FndsClient) NewDeploymentStageTransitionEvent ¶
func (*FndsClient) NewStageTransitionEvent ¶
type FndsClientOption ¶
type FndsClientOption func(*FndsClient)
func WithHTTPClient ¶
func WithHTTPClient(httpClient *http.Client) FndsClientOption
type LedgerClient ¶
type LedgerClient interface {
ListInstances(ctx context.Context, functionVersionId uuid.UUID) ([]fndstypes.Instance, error)
ListInstancesV2(ctx context.Context, functionVersionId uuid.UUID, deploymentId uuid.UUID) ([]fndstypes.Instance, error)
NewStageTransitionEvent(
ncaId string,
functionId uuid.UUID,
functionVersionId uuid.UUID,
instanceId string,
event string,
eventType string,
detailsJSON []byte,
) (fndstypes.StageTransitionEvent, error)
NewDeploymentStageTransitionEvent(
ncaId string,
functionId uuid.UUID,
functionVersionId uuid.UUID,
deploymentId uuid.UUID,
instanceId string,
event string,
eventType string,
detailsJSON []byte,
) (fndstypes.DeploymentStageTransitionEvent, error)
CreateEvent(ctx context.Context, eventData fndstypes.StageTransitionEvent) error
CreateEventV2(ctx context.Context, eventData fndstypes.DeploymentStageTransitionEvent) error
GetEvents(ctx context.Context, functionVersionId uuid.UUID, instanceId string) ([]fndstypes.StageTransitionEvent, error)
GetEventsV2(ctx context.Context, functionVersionId uuid.UUID, deploymentId uuid.UUID, instanceId string) ([]fndstypes.DeploymentStageTransitionEvent, error)
GetEventByEventType(ctx context.Context, functionVersionId uuid.UUID, instanceId string, eventType string) (fndstypes.StageTransitionEvent, error)
GetEventByEventTypeV2(
ctx context.Context,
functionVersionId uuid.UUID,
deploymentId uuid.UUID,
instanceId string,
eventType string,
) (fndstypes.DeploymentStageTransitionEvent, error)
DeleteInstanceEvents(ctx context.Context, functionVersionId uuid.UUID, instanceId string) error
DeleteInstanceEventsV2(ctx context.Context, functionVersionId uuid.UUID, deploymentId uuid.UUID, instanceId string) error
DeleteFunctionVersionEvents(ctx context.Context, functionVersionId uuid.UUID) error
DeleteFunctionVersionEventsV2(ctx context.Context, functionVersionId uuid.UUID, deploymentId uuid.UUID) error
GetStats(ctx context.Context, functionVersionId uuid.UUID) (fndstypes.DeploymentStats, error)
GetStatsV2(ctx context.Context, functionVersionId uuid.UUID, deploymentId uuid.UUID) (fndstypes.DeploymentStats, error)
}
type SimpleAPIError ¶
SimpleAPIError is a minimal wrapper that contains the HTTP status code and the raw JSON error response as a string
func (*SimpleAPIError) Error ¶
func (e *SimpleAPIError) Error() string
Click to show internal directories.
Click to hide internal directories.