grpc

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: LGPL-2.1 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultGRPCPort = 15450
	DefaultPoolSize = 10
	DefaultPoolTTL  = time.Minute
	// DefaultPoolMaxStreams maximum streams on a connections (20)
	DefaultPoolMaxStreams = 20

	// DefaultPoolMaxIdle maximum idle conns of a pool (50)
	DefaultPoolMaxIdle = 50
)

Variables

View Source
var (
	ErrAlreadyStarted = errors.New("cmd already started")
	ErrNotStarted     = errors.New("cmd not started")
)

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(cfg Config) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) Execute

func (c *Client) Execute(ctx context.Context, shell string, opts ...client.ExecOption) (client.ICmd, error)

func (*Client) Get

func (c *Client) Get(ctx context.Context, src, dst string, opts ...client.GetOption) (err error)

func (*Client) Name

func (c *Client) Name() string

func (*Client) Put

func (c *Client) Put(ctx context.Context, src, dst string, opts ...client.PutOption) (err error)

func (*Client) ReadFile added in v0.2.0

func (c *Client) ReadFile(ctx context.Context, name string) (data []byte, err error)

func (*Client) Stat

func (c *Client) Stat(ctx context.Context, name string) (*client.Stat, error)

type Cmd

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

func (*Cmd) Close

func (c *Cmd) Close() error

func (*Cmd) CombinedOutput

func (c *Cmd) CombinedOutput() ([]byte, error)

func (*Cmd) Run

func (c *Cmd) Run() error

func (*Cmd) Start

func (c *Cmd) Start() error

func (*Cmd) StderrPipe

func (c *Cmd) StderrPipe() (io.Reader, error)

func (*Cmd) StdinPipe

func (c *Cmd) StdinPipe() (io.WriteCloser, error)

func (*Cmd) StdoutPipe

func (c *Cmd) StdoutPipe() (io.Reader, error)

func (*Cmd) Wait

func (c *Cmd) Wait() error

type Config

type Config struct {
	Address string
	Timeout time.Duration
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(lg *zap.Logger, addr string) *Config

func (*Config) Validate

func (cfg *Config) Validate() error

Jump to

Keyboard shortcuts

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