server

package
v0.131.2 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: MPL-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultIP = net.IP{127, 0, 0, 1}
	Localhost = "Localhost"
)

Functions

func GenerateX509Cert added in v0.97.4

func GenerateX509Cert(sn *big.Int, from, to time.Time, hostname string) *x509.Certificate

func GenerateX509PEMs added in v0.97.4

func GenerateX509PEMs(cert *x509.Certificate, key *ecdsa.PrivateKey) (certPem, keyPem []byte, err error)

func GetDeviceName added in v0.115.4

func GetDeviceName() (string, error)

func GetOutboundIP added in v0.102.2

func GetOutboundIP() (net.IP, error)

func PublicTLSCert

func PublicTLSCert() (string, error)

func RemoveSuffix added in v0.115.4

func RemoveSuffix(input, suffix string) string

func ToECDSA added in v0.102.2

func ToECDSA(d []byte) *ecdsa.PrivateKey

ToECDSA takes a []byte of D and uses it to create an ecdsa.PublicKey on the elliptic.P256 curve this function is basically a P256 curve version of eth-node/crypto.ToECDSA without all the nice validation

Types

type HandlerPatternMap added in v0.102.2

type HandlerPatternMap map[string]http.HandlerFunc

type MediaServer added in v0.102.2

type MediaServer struct {
	Server
	// contains filtered or unexported fields
}

func NewMediaServer added in v0.102.2

func NewMediaServer(db *sql.DB, downloader *ipfs.Downloader, multiaccountsDB *multiaccounts.Database) (*MediaServer, error)

NewMediaServer returns a *MediaServer

func (*MediaServer) GetPort added in v0.113.0

func (p *MediaServer) GetPort() int

GetPort gets the current value of portManager.port without any concern for the state of its value and therefore does not wait if portManager.port is 0

func (*MediaServer) MakeAudioURL added in v0.102.2

func (s *MediaServer) MakeAudioURL(id string) string

func (*MediaServer) MakeDiscordAttachmentURL added in v0.111.5

func (s *MediaServer) MakeDiscordAttachmentURL(messageID string, id string) string

func (*MediaServer) MakeDiscordAuthorAvatarURL added in v0.111.5

func (s *MediaServer) MakeDiscordAuthorAvatarURL(authorID string) string

func (*MediaServer) MakeIdenticonURL added in v0.102.2

func (s *MediaServer) MakeIdenticonURL(from string) string

func (*MediaServer) MakeImageServerURL added in v0.102.2

func (s *MediaServer) MakeImageServerURL() string

func (*MediaServer) MakeImageURL added in v0.102.2

func (s *MediaServer) MakeImageURL(id string) string

func (*MediaServer) MakeQRURL added in v0.129.3

func (s *MediaServer) MakeQRURL(qurul string) string

func (*MediaServer) MakeStickerURL added in v0.102.2

func (s *MediaServer) MakeStickerURL(stickerHash string) string

func (*MediaServer) MustGetPort added in v0.113.0

func (p *MediaServer) MustGetPort() int

MustGetPort only returns portManager.port if portManager.port is not 0.

func (*MediaServer) ResetPort added in v0.113.0

func (p *MediaServer) ResetPort()

ResetPort resets portManger.port to 0

func (*MediaServer) SetPort added in v0.113.0

func (p *MediaServer) SetPort(port int) error

SetPort sets portManger.port field to the given port value next triggers any given portManger.afterPortChanged function

type QROptions added in v0.129.3

type QROptions struct {
	URL                  string `json:"url"`
	ErrorCorrectionLevel string `json:"errorCorrectionLevel"`
	Capacity             string `json:"capacity"`
	AllowProfileImage    bool   `json:"withLogo"`
}

type Server

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

func NewServer

func NewServer(cert *tls.Certificate, hostname string, afterPortChanged func(int), logger *zap.Logger) Server

func (*Server) AddHandlers added in v0.106.3

func (s *Server) AddHandlers(handlers HandlerPatternMap)

func (*Server) GetCert added in v0.118.0

func (s *Server) GetCert() *tls.Certificate

func (*Server) GetHostname added in v0.118.0

func (s *Server) GetHostname() string

func (*Server) GetLogger added in v0.118.0

func (s *Server) GetLogger() *zap.Logger

func (*Server) GetPort added in v0.113.0

func (p *Server) GetPort() int

GetPort gets the current value of portManager.port without any concern for the state of its value and therefore does not wait if portManager.port is 0

func (*Server) MakeBaseURL added in v0.102.2

func (s *Server) MakeBaseURL() *url.URL

func (*Server) MustGetPort added in v0.113.0

func (p *Server) MustGetPort() int

MustGetPort only returns portManager.port if portManager.port is not 0.

func (*Server) ResetPort added in v0.113.0

func (p *Server) ResetPort()

ResetPort resets portManger.port to 0

func (*Server) SetHandlers added in v0.102.2

func (s *Server) SetHandlers(handlers HandlerPatternMap)

func (*Server) SetPort added in v0.113.0

func (p *Server) SetPort(port int) error

SetPort sets portManger.port field to the given port value next triggers any given portManger.afterPortChanged function

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop() error

func (*Server) ToBackground

func (s *Server) ToBackground()

func (*Server) ToForeground

func (s *Server) ToForeground()

type WriterCloserByteBuffer added in v0.129.3

type WriterCloserByteBuffer struct {
	*bytes.Buffer
}

func NewWriterCloserByteBuffer added in v0.129.3

func NewWriterCloserByteBuffer() *WriterCloserByteBuffer

func (WriterCloserByteBuffer) Close added in v0.129.3

func (wc WriterCloserByteBuffer) Close() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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