Documentation
¶
Index ¶
- Constants
- Variables
- type APIError
- type Client
- func (c *Client) Checker(ctx context.Context, check *healthcheck.CheckState) error
- func (c *Client) CreateFileEvent(ctx context.Context, event files.FileEvent, headers Headers) (*files.FileEvent, error)
- func (c *Client) DeleteFile(ctx context.Context, filePath string, headers Headers) error
- func (c *Client) GetFile(ctx context.Context, filePath string, headers Headers) (*files.StoredRegisteredMetaData, error)
- func (c *Client) Health() *health.Client
- func (c *Client) MarkFilePublished(ctx context.Context, filePath string, headers Headers) error
- func (c *Client) URL() string
- type Clienter
- type FilePatchRequest
- type Headers
Constants ¶
const ( Authorization string = "Authorization" BearerPrefix string = "Bearer " )
Variables ¶
var (
ErrMissingResponseBody = errors.New("missing response body")
)
List of errors that can be returned by the SDK
Functions ¶
This section is empty.
Types ¶
type APIError ¶ added in v1.14.0
type APIError struct {
StatusCode int
Errors *api.JSONErrors
}
APIError represents an error returned by the files API
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the SDK client for dp-files-api
func NewWithHealthClient ¶
NewWithHealthClient creates a new instance of Client, reusing the URL and Clienter from the provided health check client
func (*Client) Checker ¶
func (c *Client) Checker(ctx context.Context, check *healthcheck.CheckState) error
Checker Calls the health.Client's Checker method
func (*Client) CreateFileEvent ¶
func (c *Client) CreateFileEvent(ctx context.Context, event files.FileEvent, headers Headers) (*files.FileEvent, error)
CreateFileEvent creates a new file event in the audit log and returns the created event
func (*Client) DeleteFile ¶ added in v1.14.0
DeleteFile deletes a file at the specified filePath
func (*Client) GetFile ¶ added in v1.14.0
func (c *Client) GetFile(ctx context.Context, filePath string, headers Headers) (*files.StoredRegisteredMetaData, error)
GetFile retrieves the metadata for a file at the specified path
func (*Client) MarkFilePublished ¶ added in v1.14.0
MarkFilePublished makes a PATCH request using patchFile to set the file state to "PUBLISHED"
type Clienter ¶ added in v1.14.0
type Clienter interface {
Checker(ctx context.Context, check *healthcheck.CheckState) error
Health() *health.Client
URL() string
CreateFileEvent(ctx context.Context, event files.FileEvent, headers Headers) (*files.FileEvent, error)
DeleteFile(ctx context.Context, filePath string, headers Headers) error
GetFile(ctx context.Context, filePath string, headers Headers) (*files.StoredRegisteredMetaData, error)
MarkFilePublished(ctx context.Context, filePath string, headers Headers) error
}
type FilePatchRequest ¶ added in v1.14.0
type FilePatchRequest struct {
api.StateMetadata
ETag string `json:"etag,omitempty"`
}
FilePatchRequest represents the request payload for a PATCH request to "/files/{path:.*}" It includes StateMetadata and an optional ETag as some handlers require it