files

package
v2.112.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2022 License: MIT Imports: 12 Imported by: 12

README

Static File Upload Client

Usage

Setup
c := files.NewAPIClient("http://localhost:26900")
Set collection ID
err := c.SetCollectionID(context.Background(), "testing/test.txt", "123456789")

if err != nil {
	...
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFileNotFound            = errors.New("file not found on dp-files-api")
	ErrFileAlreadyInCollection = errors.New("file collection ID already set")
	ErrNoFilesInCollection     = errors.New("no file in the collection")
	ErrInvalidState            = errors.New("files in an invalid state to publish")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is an files API client which can be used to make requests to the server. It extends the generic healthcheck Client structure.

func NewAPIClient

func NewAPIClient(filesAPIURL string) *Client

NewAPIClient creates a new instance of files Client with a given image API URL

func (*Client) Checker

func (c *Client) Checker(ctx context.Context, check *health.CheckState) error

Checker calls image api health endpoint and returns a check object to the caller.

func (*Client) PublishCollection

func (c *Client) PublishCollection(ctx context.Context, collectionID string) error

func (*Client) SetCollectionID

func (c *Client) SetCollectionID(ctx context.Context, filepath, collectionID string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL