Documentation
¶
Index ¶
- Constants
- func ExitCode(err error) int
- type APIError
- type Client
- func (c *Client) CancelWorkflowRun(ctx context.Context, workflowID, runID string) error
- func (c *Client) CreateAccess(ctx context.Context, access *models.Access) (*models.Access, error)
- func (c *Client) CreateWorkflow(ctx context.Context, workflow *models.Workflow) (*models.Workflow, error)
- func (c *Client) DeleteAccess(ctx context.Context, id string) error
- func (c *Client) DeleteWorkflow(ctx context.Context, id string) error
- func (c *Client) Do(ctx context.Context, method, path string, body interface{}, result interface{}) error
- func (c *Client) DownloadCertificate(ctx context.Context, certificateID, format string) ([]byte, error)
- func (c *Client) GetAccess(ctx context.Context, id string) (*models.Access, error)
- func (c *Client) GetCertificate(ctx context.Context, id string) (*models.Certificate, error)
- func (c *Client) GetWorkflow(ctx context.Context, id string) (*models.Workflow, error)
- func (c *Client) GetWorkflowRun(ctx context.Context, runID string) (*models.WorkflowRun, error)
- func (c *Client) ListAccess(ctx context.Context, filter, sort string, page, perPage int) (*ListResponse[models.Access], error)
- func (c *Client) ListCertificates(ctx context.Context, filter, sort string, page, perPage int) (*ListResponse[models.Certificate], error)
- func (c *Client) ListWorkflowRuns(ctx context.Context, workflowID string, page, perPage int) (*ListResponse[models.WorkflowRun], error)
- func (c *Client) ListWorkflows(ctx context.Context, filter, sort string, page, perPage int) (*ListResponse[models.Workflow], error)
- func (c *Client) RunWorkflow(ctx context.Context, workflowID string) (string, error)
- func (c *Client) SetInsecure(insecure bool)
- func (c *Client) UpdateAccess(ctx context.Context, id string, access *models.Access) (*models.Access, error)
- func (c *Client) UpdateWorkflow(ctx context.Context, id string, workflow *models.Workflow) (*models.Workflow, error)
- func (c *Client) ValidateConnection(ctx context.Context) error
- type ListResponse
- type NetworkError
Constants ¶
const ( ExitSuccess = 0 ExitError = 1 ExitUsage = 2 ExitAuth = 3 ExitNetwork = 4 ExitNotFound = 5 )
Exit codes
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIError ¶
type APIError struct {
StatusCode int `json:"-"`
Code int `json:"code"`
Message string `json:"message"`
Data any `json:"data"`
}
APIError represents an error from the API
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the API client for Certimate
func (*Client) CancelWorkflowRun ¶
CancelWorkflowRun cancels a running workflow
func (*Client) CreateAccess ¶
CreateAccess creates a new access credential
func (*Client) CreateWorkflow ¶
func (c *Client) CreateWorkflow(ctx context.Context, workflow *models.Workflow) (*models.Workflow, error)
CreateWorkflow creates a new workflow
func (*Client) DeleteAccess ¶
DeleteAccess deletes an access credential
func (*Client) DeleteWorkflow ¶
DeleteWorkflow deletes a workflow
func (*Client) Do ¶
func (c *Client) Do(ctx context.Context, method, path string, body interface{}, result interface{}) error
Do performs an HTTP request
func (*Client) DownloadCertificate ¶
func (c *Client) DownloadCertificate(ctx context.Context, certificateID, format string) ([]byte, error)
DownloadCertificate downloads a certificate in the specified format
func (*Client) GetCertificate ¶
GetCertificate fetches a single certificate by ID
func (*Client) GetWorkflow ¶
GetWorkflow fetches a single workflow by ID
func (*Client) GetWorkflowRun ¶
GetWorkflowRun fetches a single workflow run by ID
func (*Client) ListAccess ¶
func (c *Client) ListAccess(ctx context.Context, filter, sort string, page, perPage int) (*ListResponse[models.Access], error)
ListAccess fetches all access credentials with optional filtering
func (*Client) ListCertificates ¶
func (c *Client) ListCertificates(ctx context.Context, filter, sort string, page, perPage int) (*ListResponse[models.Certificate], error)
ListCertificates fetches all certificates with optional filtering
func (*Client) ListWorkflowRuns ¶
func (c *Client) ListWorkflowRuns(ctx context.Context, workflowID string, page, perPage int) (*ListResponse[models.WorkflowRun], error)
ListWorkflowRuns fetches workflow execution history
func (*Client) ListWorkflows ¶
func (c *Client) ListWorkflows(ctx context.Context, filter, sort string, page, perPage int) (*ListResponse[models.Workflow], error)
ListWorkflows fetches all workflows with optional filtering
func (*Client) RunWorkflow ¶
RunWorkflow executes a workflow via custom API
func (*Client) SetInsecure ¶
SetInsecure skips TLS verification
func (*Client) UpdateAccess ¶
func (c *Client) UpdateAccess(ctx context.Context, id string, access *models.Access) (*models.Access, error)
UpdateAccess updates an existing access credential
type ListResponse ¶
type ListResponse[T any] struct { Page int `json:"page"` PerPage int `json:"perPage"` TotalItems int `json:"totalItems"` TotalPages int `json:"totalPages"` Items []T `json:"items"` }
ListResponse is the standard PocketBase response for list queries
type NetworkError ¶
type NetworkError struct {
Err error
}
NetworkError represents a network connectivity error
func (*NetworkError) Error ¶
func (e *NetworkError) Error() string
func (*NetworkError) Unwrap ¶
func (e *NetworkError) Unwrap() error