public

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: AGPL-3.0, Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnauthorized = errors.New("unauthorized")
)

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(cfg ClientConfig, opts ...ClientOption) (*Client, error)

func (*Client) AuthToken

func (c *Client) AuthToken() string

func (*Client) Close

func (c *Client) Close() error

func (*Client) CreateJob

func (c *Client) CreateJob(cfg job.Config) (job.Job, error)

func (*Client) GetJob

func (c *Client) GetJob(jobID string) (job.Job, error)

func (*Client) GetJobLogs

func (c *Client) GetJobLogs(jobID string) ([]byte, error)

func (*Client) GetVersionInfo

func (c *Client) GetVersionInfo() (VersionInfo, error)

func (*Client) Init

func (c *Client) Init(cfg job.ServiceConfig) error

func (*Client) Login

func (c *Client) Login(clientID string, authKey string) error

func (*Client) Register

func (c *Client) Register(clientID string, authKey string) error

func (*Client) URL

func (c *Client) URL() string

func (*Client) Unregister

func (c *Client) Unregister(clientID string) error

type ClientConfig

type ClientConfig struct {
	ClientID string
	AuthKey  string
	URL      string
	// contains filtered or unexported fields
}

func (*ClientConfig) Parse

func (c *ClientConfig) Parse() error

type ClientOption

type ClientOption func(c *Client) error

func WithDialFunc

func WithDialFunc(dialFn DialContextFn) ClientOption

WithDialFunc lets the caller set an optional dialing function to setup the HTTP/WebSocket connections used by the client.

type DialContextFn

type DialContextFn func(ctx context.Context, network, addr string) (net.Conn, error)

type VersionInfo

type VersionInfo struct {
	BuildDate    string `json:"buildDate"`
	BuildVersion string `json:"buildVersion"`
	BuildHash    string `json:"buildHash"`
	GoVersion    string `json:"goVersion"`
}

func (VersionInfo) LogFields

func (v VersionInfo) LogFields() []mlog.Field

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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