provider

package
v0.0.0-...-890cd7e Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: GPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Memory

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

Memory is a in memory outbounds provider.

func NewMemory

func NewMemory(outbounds []adapter.Outbound) *Memory

NewMemory creates a new memory provider.

func (*Memory) Close

func (s *Memory) Close() error

Close closes the service.

func (*Memory) Outbound

func (s *Memory) Outbound(tag string) (adapter.Outbound, bool)

Outbound returns the outbound from the provider.

func (*Memory) Outbounds

func (s *Memory) Outbounds() []adapter.Outbound

Outbounds returns all the outbounds from the provider.

func (*Memory) Start

func (s *Memory) Start() error

Start starts the provider.

func (*Memory) Tag

func (s *Memory) Tag() string

Tag returns the tag of the provider.

func (*Memory) Update

func (s *Memory) Update() error

Update closes the service.

func (*Memory) UpdatedAt

func (s *Memory) UpdatedAt() time.Time

UpdatedAt implements adapter.Provider

func (*Memory) Wait

func (s *Memory) Wait()

Wait implements adapter.Provider

type Remote

type Remote struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Remote is a remote outbounds provider.

func NewRemote

func NewRemote(ctx context.Context, router adapter.Router, logger log.ContextLogger, logFactory log.Factory, options option.Provider) (*Remote, error)

NewRemote creates a new remote provider.

func (*Remote) Close

func (s *Remote) Close() error

Close closes the service.

func (*Remote) Outbound

func (s *Remote) Outbound(tag string) (adapter.Outbound, bool)

Outbound returns the outbound from the provider.

func (*Remote) Outbounds

func (s *Remote) Outbounds() []adapter.Outbound

Outbounds returns all the outbounds from the provider.

func (*Remote) Ready

func (s *Remote) Ready() <-chan struct{}

Ready returns a channel that's closed when provider is ready.

func (*Remote) Start

func (s *Remote) Start() error

Start starts the provider.

func (*Remote) Tag

func (s *Remote) Tag() string

Tag returns the tag of the provider.

func (*Remote) Update

func (s *Remote) Update() error

Update fetches and updates outbounds from the provider.

func (*Remote) UpdatedAt

func (s *Remote) UpdatedAt() time.Time

UpdatedAt implements adapter.Provider

func (*Remote) Wait

func (s *Remote) Wait()

Wait implements adapter.Provider

Jump to

Keyboard shortcuts

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