tcp

package module
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: MIT Imports: 14 Imported by: 1

README

Documentation

Index

Constants

View Source
const (
	RrMode string = "RR_MODE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Servers        map[string]*Srv `mapstructure:"servers"`
	ReadBufferSize int             `mapstructure:"read_buf_size"`
	Pool           *pool.Config    `mapstructure:"pool"`
}

func (*Config) InitDefault

func (c *Config) InitDefault() error

type Configurer

type Configurer interface {
	// UnmarshalKey takes a single key and unmarshal it into a Struct.
	UnmarshalKey(name string, out any) error
	// Has checks if config section exists.
	Has(name string) bool
}

type Plugin

type Plugin struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*Plugin) Close

func (p *Plugin) Close(uuid string) error

func (*Plugin) Exec

func (p *Plugin) Exec(pld *payload.Payload) (*payload.Payload, error)

func (*Plugin) Init

func (p *Plugin) Init(log *zap.Logger, cfg Configurer, server Server) error

func (*Plugin) Name

func (p *Plugin) Name() string

func (*Plugin) RPC

func (p *Plugin) RPC() interface{}

func (*Plugin) Reset

func (p *Plugin) Reset() error

func (*Plugin) Serve

func (p *Plugin) Serve() chan error

func (*Plugin) Stop

func (p *Plugin) Stop() error

func (*Plugin) Workers

func (p *Plugin) Workers() []*process.State

type Pool

type Pool interface {
	// Workers returns worker list associated with the pool.
	Workers() (workers []*worker.Process)

	// Exec payload
	Exec(ctx context.Context, p *payload.Payload) (*payload.Payload, error)

	// Reset kill all workers inside the watcher and replaces with new
	Reset(ctx context.Context) error

	// Destroy all underlying stack (but let them complete the task).
	Destroy(ctx context.Context)
}

type Server

type Server interface {
	NewPool(ctx context.Context, cfg *pool.Config, env map[string]string, _ *zap.Logger) (*staticPool.Pool, error)
}

Server creates workers for the application.

type Srv

type Srv struct {
	Addr      string `mapstructure:"addr"`
	Delimiter string `mapstructure:"delimiter"`
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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