server

package
v0.0.0-...-d46a54d Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessorService

type AccessorService interface {
	HostToProxyServer(host string) (domain.ProxyServer, bool)
	DefaultServer() (domain.ProxyServer, bool)
	Find(name string) (domain.ProxyServer, bool)
	Servers() domain.ProxyServers
}

AccessorService provides methods to access proxy servers

type ManagerService

type ManagerService interface {
	Save(domain.ProxyServer) (domain.ProxyServer, error)
	Remove(ID int64) bool
}

ManagerService provides methods to manage proxy servers

type Service

type Service interface {
	ManagerService
	AccessorService
}

Service provides methods for proxy servers

func NewService

func NewService(logger *zerolog.Logger, servers domain.ProxyServers) Service

NewService created new server service instance

type Storage

type Storage interface {
	GetAll() domain.ProxyServers
	GetServer(ID int64) (domain.ProxyServer, bool)
	Save(domain.ProxyServer) (domain.ProxyServer, error)
	Remove(ID int64) bool
}

Storage provides storage for servers

func NewStorage

func NewStorage(logger *zerolog.Logger, servers domain.ProxyServers, storageSize int, storageDuration time.Duration) Storage

NewStorage creates new instance of server storage using in memory cache as storage backend

Jump to

Keyboard shortcuts

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