client

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Overview

Package client talks to import-deploy.

Every call has a Context variant. Use it: it carries the caller's trace and baggage onto the wire, which is what lets import-deploy -- and the import container it deploys -- log under the context of whatever caused the call. A smart service worker that passes its instance id this way gets it back on every log line the resulting import ever writes.

The variants without a context are kept so existing callers still build. They pass context.TODO(), so import-deploy starts a trace of its own and the connection to the caller is lost.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func (*Client) CountInstances added in v0.0.3

func (c *Client) CountInstances(jwt jwt.Token, search string, includeGenerated bool) (count int64, err error, errCode int)

func (*Client) CountInstancesContext added in v0.2.0

func (c *Client) CountInstancesContext(ctx context.Context, jwt jwt.Token, search string, includeGenerated bool) (count int64, err error, errCode int)

func (*Client) CreateInstance

func (c *Client) CreateInstance(instance model.Instance, jwt jwt.Token) (result model.Instance, err error, code int)

func (*Client) CreateInstanceContext added in v0.2.0

func (c *Client) CreateInstanceContext(ctx context.Context, instance model.Instance, jwt jwt.Token) (result model.Instance, err error, code int)

func (*Client) DeleteInstance

func (c *Client) DeleteInstance(id string, jwt jwt.Token, forUser string) (err error, errCode int)

func (*Client) DeleteInstanceContext added in v0.2.0

func (c *Client) DeleteInstanceContext(ctx context.Context, id string, jwt jwt.Token, forUser string) (err error, errCode int)

func (*Client) ListInstances

func (c *Client) ListInstances(jwt jwt.Token, limit int64, offset int64, sort string, asc bool, search string, includeGenerated bool, forUser string) (results []model.Instance, err error, errCode int)

func (*Client) ListInstancesContext added in v0.2.0

func (c *Client) ListInstancesContext(ctx context.Context, jwt jwt.Token, limit int64, offset int64, sort string, asc bool, search string, includeGenerated bool, forUser string) (results []model.Instance, err error, errCode int)

func (*Client) ReadInstance

func (c *Client) ReadInstance(id string, jwt jwt.Token, forUser string) (result model.Instance, err error, errCode int)

func (*Client) ReadInstanceContext added in v0.2.0

func (c *Client) ReadInstanceContext(ctx context.Context, id string, jwt jwt.Token, forUser string) (result model.Instance, err error, errCode int)

func (*Client) SetInstance

func (c *Client) SetInstance(importType model.Instance, jwt jwt.Token) (err error, code int)

func (*Client) SetInstanceContext added in v0.2.0

func (c *Client) SetInstanceContext(ctx context.Context, importType model.Instance, jwt jwt.Token) (err error, code int)

type Interface

type Interface interface {
	ListInstances(jwt jwt.Token, limit int64, offset int64, sort string, asc bool, search string, includeGenerated bool, forUser string) (results []model.Instance, err error, errCode int)
	ListInstancesContext(ctx context.Context, jwt jwt.Token, limit int64, offset int64, sort string, asc bool, search string, includeGenerated bool, forUser string) (results []model.Instance, err error, errCode int)
	ReadInstance(id string, jwt jwt.Token, forUser string) (result model.Instance, err error, errCode int)
	ReadInstanceContext(ctx context.Context, id string, jwt jwt.Token, forUser string) (result model.Instance, err error, errCode int)
	CreateInstance(instance model.Instance, jwt jwt.Token) (result model.Instance, err error, code int)
	CreateInstanceContext(ctx context.Context, instance model.Instance, jwt jwt.Token) (result model.Instance, err error, code int)
	SetInstance(importType model.Instance, jwt jwt.Token) (err error, code int)
	SetInstanceContext(ctx context.Context, importType model.Instance, jwt jwt.Token) (err error, code int)
	DeleteInstance(id string, jwt jwt.Token, forUser string) (err error, errCode int)
	DeleteInstanceContext(ctx context.Context, id string, jwt jwt.Token, forUser string) (err error, errCode int)
	CountInstances(jwt jwt.Token, search string, includeGenerated bool) (count int64, err error, errCode int)
	CountInstancesContext(ctx context.Context, jwt jwt.Token, search string, includeGenerated bool) (count int64, err error, errCode int)
}

func NewClient

func NewClient(baseUrl string) Interface

Jump to

Keyboard shortcuts

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