client

package
v0.1.45 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package client implements a client for the opspec node api

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// AddAuth adds auth
	AddAuth(
		ctx context.Context,
		req model.AddAuthReq,
	) error

	GetEventStream(
		ctx context.Context,
		req *model.GetEventStreamReq,
	) (
		stream chan model.Event,
		err error,
	)

	// GetData gets data
	//
	// expected errs:
	//  - ErrDataProviderAuthentication on authentication failure
	//  - ErrDataProviderAuthorization on authorization failure
	//  - ErrDataRefResolution on resolution failure
	GetData(
		ctx context.Context,
		req model.GetDataReq,
	) (
		model.ReadSeekCloser,
		error,
	)

	KillOp(
		ctx context.Context,
		req model.KillOpReq,
	) (
		err error,
	)

	// ListDescendants lists file system entries
	//
	// expected errs:
	//  - ErrDataProviderAuthentication on authentication failure
	//  - ErrDataProviderAuthorization on authorization failure
	//  - ErrDataRefResolution on resolution failure
	ListDescendants(
		ctx context.Context,
		req model.ListDescendantsReq,
	) (
		[]*model.DirEntry,
		error,
	)

	// Liveness ensures liveness of the node
	Liveness(
		ctx context.Context,
	) error

	StartOp(
		ctx context.Context,
		req model.StartOpReq,
	) (
		opID string,
		err error,
	)
}

func New

func New(
	baseUrl url.URL,
	opts *Opts,
) Client

New returns a new client nil opts will be ignored

type Opts

type Opts struct {
	// RetryLogHook will be executed anytime a request is retried
	RetryLogHook func(err error)
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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