manager

package
v0.0.0-...-c5d1e48 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2023 License: AGPL-3.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Mapper = make(map[string]Creator)

Functions

func Register

func Register(name string, c Creator)

Types

type Creator

type Creator func(conn Dialer, arg ManageArgument) (Manager, error)

type Dialer

type Dialer interface {
	// DialContext connects to the given address
	Dial(network, addr string) (c netproxy.Conn, err error)
	DialContext(ctx context.Context, network, addr string) (c netproxy.Conn, err error)
}

Dialer is used to create connection.

type DialerConverter

type DialerConverter struct {
	Dialer proxy.Dialer
}

func (*DialerConverter) Dial

func (d *DialerConverter) Dial(network, addr string) (c netproxy.Conn, err error)

func (*DialerConverter) DialContext

func (d *DialerConverter) DialContext(ctx context.Context, network, addr string) (c netproxy.Conn, err error)

type ManageArgument

type ManageArgument struct {
	Host       string
	Port       string
	RootDomain string // this is for TLS SNI
	model.Argument
}

type Manager

type Manager interface {
	Ping(ctx context.Context) (resp *model.PingResp, err error)
	SyncPassages(ctx context.Context, passages []model.Passage) (err error)
}

func NewManager

func NewManager(dialer Dialer, arg ManageArgument) (Manager, error)

type ReaderCloser

type ReaderCloser struct {
	Reader io.Reader
	Closer io.Closer
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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