server

package
v0.0.0-...-071f0a0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigSection = "server"
View Source
const Response = "test"

Variables

This section is empty.

Functions

This section is empty.

Types

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 Foo

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

func (*Foo) Init

func (f *Foo) Init(p Configurer, workerFactory Server) error

func (*Foo) Serve

func (f *Foo) Serve() chan error

func (*Foo) Stop

func (f *Foo) Stop(context.Context) error

type Foo2

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

func (*Foo2) Init

func (f *Foo2) Init(p Configurer, workerFactory Server) error

func (*Foo2) Serve

func (f *Foo2) Serve() chan error

func (*Foo2) Stop

func (f *Foo2) Stop(context.Context) error

type Foo3

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

func (*Foo3) Init

func (f *Foo3) Init(p Configurer, workerFactory Server) error

func (*Foo3) Serve

func (f *Foo3) Serve() chan error

func (*Foo3) Stop

func (f *Foo3) Stop(context.Context) error

type Foo4

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

func (*Foo4) Init

func (f *Foo4) Init(p Configurer, workerFactory Server, log Logger) error

func (*Foo4) Serve

func (f *Foo4) Serve() chan error

func (*Foo4) Stop

func (f *Foo4) Stop(context.Context) error

type Logger

type Logger interface {
	NamedLogger(string) *zap.Logger
}

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, stopCh chan struct{}) (chan *staticPool.PExec, 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 {
	CmdFactory(env map[string]string) func() *exec.Cmd
	NewPool(ctx context.Context, cfg *pool.Config, env map[string]string, _ *zap.Logger) (*staticPool.Pool, error)
	NewWorker(ctx context.Context, env map[string]string) (*worker.Process, error)
}

Server creates workers for the application.

Jump to

Keyboard shortcuts

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