client

package
v1.0.0-beta Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionOption

type ActionOption struct {
	PartitionID *int
	Name        string
	Alone       *bool
}

func (ActionOption) SetAlone

func (opt ActionOption) SetAlone(alone bool) ActionOption

func (ActionOption) SetName

func (opt ActionOption) SetName(name string) ActionOption

func (ActionOption) SetPartition

func (opt ActionOption) SetPartition(partition int) ActionOption

type Agent

type Agent interface {
	CloseWithContext(ctx context.Context) error
}

type Client

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

func New

func New(agent Agent, option Option) *Client

func (*Client) CloseWithContext

func (client *Client) CloseWithContext(ctx context.Context) error

func (*Client) Closed

func (client *Client) Closed() bool

func (*Client) Do

func (client *Client) Do(ctx context.Context, operation func(ctx context.Context, agent Agent) error, opts ...ActionOption) error

type DoMiddle

type DoMiddle interface {
	WrapDo(func(ctx context.Context, agent Agent) error, ActionOption) func(ctx context.Context, agent Agent) error
}

type Option

type Option struct {
	ParallelCount *int
	Middles       []DoMiddle
}

func (Option) AddMiddle

func (opt Option) AddMiddle(middle ...DoMiddle) Option

func (Option) SetParallelCount

func (opt Option) SetParallelCount(count int) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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