kdeploy_client_go

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

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
}

Client is a kdeploy gRPC client

func NewClient

func NewClient(ctx context.Context, target string, opts ...Opt) (*Client, error)

NewClient creates a new gRPC kdeploy client

func (*Client) CreateApp

func (c *Client) CreateApp(ctx context.Context, app *kdeploypb.AppInput) (*kdeploypb.App, error)

CreateApp creates a new application

func (*Client) CreateTask added in v0.0.1

func (c *Client) CreateTask(ctx context.Context, app *kdeploypb.TaskInput) (*kdeploypb.Task, error)

CreateTask creates a new task

func (*Client) DeleteAll added in v0.0.1

func (c *Client) DeleteAll(ctx context.Context, namespace *kdeploypb.Namespace) error

DeleteApp deletes all tasks/applications in the namespace

func (*Client) DeleteApp

func (c *Client) DeleteApp(ctx context.Context, ref *kdeploypb.Ref) error

DeleteApp deletes an application by reference(name/namespace)

func (*Client) DeleteTask added in v0.0.1

func (c *Client) DeleteTask(ctx context.Context, ref *kdeploypb.Ref) error

DeleteTask deletes a task by reference(name/namespace)

func (*Client) GetApp

func (c *Client) GetApp(ctx context.Context, ref *kdeploypb.Ref) (*kdeploypb.App, error)

GetApp get an application by reference(name/namespace)

func (*Client) GetTask added in v0.0.1

func (c *Client) GetTask(ctx context.Context, ref *kdeploypb.Ref) (*kdeploypb.Task, error)

GetTask gets a task by reference(name/namespace)

func (*Client) StreamLogs added in v0.0.4

func (c *Client) StreamLogs(ctx context.Context, ref *kdeploypb.Ref, fn func(l *kdeploypb.Log) bool) error

StreamLogs streams logs from an application until the context cancelled or the function(fn) return false

func (*Client) UpdateApp

func (c *Client) UpdateApp(ctx context.Context, app *kdeploypb.AppInput) (*kdeploypb.App, error)

UpdateApp updates an application - it performs a full replace

func (*Client) UpdateTask added in v0.0.1

func (c *Client) UpdateTask(ctx context.Context, app *kdeploypb.TaskInput) (*kdeploypb.Task, error)

UpdateTask updates a task - it performs a full replace

type Opt

type Opt func(o *Options)

Opt is a single configuration option

func WithLogging

func WithLogging(logging, logPayload bool) Opt

WithLogging registers a logging middleware

func WithMetrics

func WithMetrics(metrics bool) Opt

WithMetrics registers prometheus metrics

func WithTokenSource

func WithTokenSource(tokenSource oauth2.TokenSource) Opt

WithTokenSource uses oauth token add an authorization header to every outbound request

func WithTransportCreds

func WithTransportCreds(creds credentials.TransportCredentials) Opt

WithTransportCreds adds transport credentials to the client

type Options

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

Options holds configuration options

Jump to

Keyboard shortcuts

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