server

package
v0.0.0-...-4def0f5 Latest Latest
Warning

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

Go to latest
Published: May 21, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Headers

type Headers map[string]string

func (Headers) String

func (h Headers) String() string

type KingCardServerManager

type KingCardServerManager struct {
	TokenApi       string
	KingCardServer *Server
	sync.Mutex
}

func NewKingCardServerManager

func NewKingCardServerManager(opts ...ManagerOption) *KingCardServerManager

func (*KingCardServerManager) NewServer

func (m *KingCardServerManager) NewServer(address, listen string, verbose bool) *Server

type ManagerOption

type ManagerOption func(*KingCardServerManager)

func WithKingCardServer

func WithKingCardServer(s *Server) ManagerOption

func WithTokenApi

func WithTokenApi(api string) ManagerOption

type Server

type Server struct {
	Listen        string
	HttpUpstream  *Upstream
	HttpsUpstream *Upstream
	Verbose       bool
}

func NewBaiduServer

func NewBaiduServer(address, listen string, verbose bool) *Server

func NewServer

func NewServer(opts ...ServerOption) *Server

func NewUcServer

func NewUcServer(listen string, verbose bool) *Server

func (*Server) Serve

func (s *Server) Serve()

type ServerOption

type ServerOption func(*Server)

func WithHttpUpstream

func WithHttpUpstream(upstream *Upstream) ServerOption

func WithHttpsUpstream

func WithHttpsUpstream(upstream *Upstream) ServerOption

func WithListen

func WithListen(listen string) ServerOption

func WithVerbose

func WithVerbose(verbose bool) ServerOption

type Upstream

type Upstream struct {
	Address string
	Headers Headers
}

func NewUpstream

func NewUpstream(opts ...UpstreamOption) *Upstream

type UpstreamOption

type UpstreamOption func(*Upstream)

func WithAddress

func WithAddress(address string) UpstreamOption

func WithHeaders

func WithHeaders(headers map[string]string) UpstreamOption

Jump to

Keyboard shortcuts

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