Documentation ¶
Overview ¶
Package client provides a client for the versions API.
The client needs to be authenticated with AWS. It should be used in internal development and CI tools for administrative tasks. For just fetching information from the API, use the fetcher package instead.
Needed IAM permissions for read mode: - "s3:GetObject" - "s3:ListBucket"
Additional needed IAM permissions for write mode: - "s3:PutObject" - "s3:DeleteObject" - "cloudfront:CreateInvalidation"
Thread-safety of the bucket is not guaranteed. The client is not thread-safe.
Each sub-API included in the Constellation Resource API should define it's resources by implementing types that implement apiObject. The new package can then call this package's Fetch and Update functions to get/modify resources from the API.
Index ¶
- func Delete(ctx context.Context, c *Client, obj APIObject) error
- func Fetch[T APIObject](ctx context.Context, c *Client, obj T) (T, error)
- func NewClient(ctx context.Context, region, bucket, distributionID string, dryRun bool, ...) (*Client, CloseFunc, error)
- func NewReadOnlyClient(ctx context.Context, region, bucket, distributionID string, log *logger.Logger) (*Client, CloseFunc, error)
- func Update(ctx context.Context, c *Client, obj APIObject) error
- type APIObject
- type Client
- type CloseFunc
- type NotFoundError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
func NewClient(ctx context.Context, region, bucket, distributionID string, dryRun bool, log *logger.Logger, ) (*Client, CloseFunc, error)
NewClient creates a new client for the versions API.
Types ¶
type APIObject ¶ added in v2.9.0
APIObject is an object that is used to perform CRUD operations on the API.
type Client ¶
type Client struct { DryRun bool // no write operations are performed Log *logger.Logger // contains filtered or unexported fields }
Client is the a general client for all APIs.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError is an error that is returned when a resource is not found.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
func (*NotFoundError) Unwrap ¶
func (e *NotFoundError) Unwrap() error