asset

package
v0.0.0-...-f85bb52 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2020 License: BSD-3-Clause Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	*flag.FlagSet

	PIDFile    string `yaml:"pid_file"`
	ListenAddr string `yaml:"listen"`
	APIPath    string `yaml:"api_path"`
	ExpvarPath string `yaml:"expvar_path"`
	PProfFile  string `yaml:"pprof"`
	PProfURL   string `yaml:"pprof_url"`
}

Config holds configuration of proxy.

func NewConfig

func NewConfig() *Config

NewConfig creates an instance of UDP mutiplex configuration.

func (*Config) Parse

func (cfg *Config) Parse(args []string) error

Parse parses configuration from command line arguments.

type Server

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

Server encapsulates a HTTP server which provide asset related information.

func NewServer

func NewServer(cfg *Config) *Server

NewServer returns a runnable HTTP server using the given configuration.

func (*Server) Run

func (s *Server) Run() error

Run runs HTTP server until either a stop signal is received or an error occurs.

type ServerCtrlResp

type ServerCtrlResp struct {
	Code      int       `json:"code"`
	Text      string    `json:"text,omitempty"`
	Timestamp time.Time `json:"ts"`
}

ServerCtrlResp is a server control response {ctrl}.

type ServerResp

type ServerResp struct {
	Ctrl *ServerCtrlResp `json:"ctrl,omitempty"`
}

ServerResp is a wrapper for server side response.

func ErrOperationNotAllowed

func ErrOperationNotAllowed(ts time.Time) *ServerResp

ErrOperationNotAllowed a valid operation is not permitted in this context (405).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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