v1

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnixClient added in v0.0.10

func UnixClient(socket string) *http.Client

Types

type Client

type Client interface {
	ReadOnlyClient
	CreateDirectory(c context.Context, r *v1.CreateDirectoryRequest, parent v1.DirectoryID) (*v1.DirectoryFetch, error)
	UpdateDirectory(c context.Context, id v1.DirectoryID, r *v1.UpdateDirectoryRequest) (*v1.DirectoryFetch, error)
	DeleteDirectory(c context.Context, id v1.DirectoryID) (*v1.DirectoryList, error)
}

Client Allows for instantiating a client with read/write access to the API.

type ClientConfig

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

func NewClientConfig

func NewClientConfig() *ClientConfig

func (*ClientConfig) WithClient

func (c *ClientConfig) WithClient(client *http.Client) *ClientConfig

func (*ClientConfig) WithManagerURL

func (c *ClientConfig) WithManagerURL(u *url.URL) *ClientConfig

func (*ClientConfig) WithManagerURLFromString

func (c *ClientConfig) WithManagerURLFromString(s string) (*ClientConfig, error)

type HTTPClient

type HTTPClient interface {
	Client
	RawHTTP
}

HTTPClient allows for instantiating a client that can do general HTTP requests.

func NewHTTPClient

func NewHTTPClient(cfg *ClientConfig) HTTPClient

type HTTPRootClient

type HTTPRootClient interface {
	RootClient
	RawHTTP
}

func NewHTTPRootClient

func NewHTTPRootClient(cfg *ClientConfig) HTTPRootClient

type RawHTTP

type RawHTTP interface {
	DoRaw(c context.Context, method, path string, data io.Reader) (*http.Response, error)
}

RawHTTP allows for instantiating a client with raw HTTP access to the API.

type ReadOnlyClient added in v0.0.3

type ReadOnlyClient interface {
	GetDirectory(c context.Context, id v1.DirectoryID, options ...storage.Option) (*v1.DirectoryFetch, error)
	GetParents(c context.Context, id v1.DirectoryID, options ...storage.Option) (*v1.DirectoryList, error)
	GetParentsUntil(c context.Context, id, until v1.DirectoryID, options ...storage.Option) (*v1.DirectoryList, error)
	GetChildren(c context.Context, id v1.DirectoryID, options ...storage.Option) (*v1.DirectoryList, error)
}

ReadOnlyClient allows for instantiating a client with read-only access to the API.

type RootClient

type RootClient interface {
	Client // Embed the Client interface
	CreateRoot(c context.Context, r *v1.CreateDirectoryRequest) (*v1.DirectoryFetch, error)
	ListRoots(c context.Context, options ...storage.Option) (*v1.DirectoryList, error)
}

RootClient allows for instantiating a client with read/write and root node access to the API.

type Watcher added in v0.0.4

type Watcher interface {
	// Watch starts watching for events.
	// It returns a channel for events and a channel for errors.
	Watch(ctx context.Context) (<-chan *v1.DirectoryEvent, <-chan error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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