server

package
v0.0.0-...-8444db5 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const GatewayHeaderKey = "X-Arcad-Gateway"
View Source
const (
	ServiceName service.Name = "tunnel-server"
)

Variables

View Source
var (
	ErrKeyNotFound           = errors.New("key not found")
	ErrUnexpectedStoredValue = errors.New("unexpected stored value")
)

Functions

func AddGatewayHeader

func AddGatewayHeader(r *http.Request)

func HasGatewayHeader

func HasGatewayHeader(r *http.Request) bool

func ServiceProvider

func ServiceProvider(funcs ...tunnel.ServerConfigFunc) service.Provider

Types

type Cache

type Cache interface {
	Get(key string) ([]byte, error)
	Has(key string) bool
	Store(key string, data []byte) error
}

type ClientRegistry

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

func NewClientRegistry

func NewClientRegistry() *ClientRegistry

func (*ClientRegistry) Add

func (r *ClientRegistry) Add(clientID, remoteAddr string, rc *tunnel.RemoteClient)

func (*ClientRegistry) Get

func (r *ClientRegistry) Get(clientID string) *tunnel.RemoteClient

func (*ClientRegistry) RemoveByRemoteAddr

func (r *ClientRegistry) RemoveByRemoteAddr(remoteAddr string)

type EtagCachingTransport

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

func NewETagCachingTransport

func NewETagCachingTransport(upstream http.RoundTripper, maxSize int64, ttl, refreshTimeout time.Duration) *EtagCachingTransport

func (*EtagCachingTransport) RoundTrip

func (t *EtagCachingTransport) RoundTrip(req *http.Request) (*http.Response, error)

type MemoryCache

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

func NewMemoryCache

func NewMemoryCache() *MemoryCache

func (*MemoryCache) Get

func (c *MemoryCache) Get(key string) ([]byte, error)

func (*MemoryCache) Has

func (c *MemoryCache) Has(key string) bool

func (*MemoryCache) Store

func (c *MemoryCache) Store(key string, data []byte) error

type Service

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

func From

func From(container *service.Container) (*Service, error)

From retrieves the gateway server service in the given service container.

func Must

func Must(container *service.Container) *Service

Must retrieves the gateway server in the given service container or panic otherwise.

func (*Service) Clients

func (s *Service) Clients() *ClientRegistry

func (*Service) Server

func (s *Service) Server() *tunnel.Server

Jump to

Keyboard shortcuts

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