server

package
v0.0.0-...-f3d4632 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2019 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultName is the default name of the server.
	DefaultName = "media-server"
)

Variables

View Source
var (
	// Version defines the version of server.
	Version = "1.0.0+git"

	// GitHash will be set during make.
	GitHash = "Not provided (use make build instead of go build)"
	// BuildTS will be set during make.
	BuildTS = "Not provided (use make build instead of go build)"
)

Functions

This section is empty.

Types

type Config

type Config struct {
	*flag.FlagSet

	ListenAddr string `toml:"addr"`

	Log logutil.LogConfig `toml:"log"`
	// contains filtered or unexported fields
}

Config keeps the configuration of server.

func NewConfig

func NewConfig() *Config

NewConfig creates an instance of server configuration.

func (*Config) Parse

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

Parse checks all configuration from command-line flags.

type Server

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

Server implements a HTTP server.

func NewServer

func NewServer(cfg *Config) *Server

NewServer creates a new instance of HTTP server.

func (*Server) Run

func (s *Server) Run() error

Run starts the HTTP server.

Jump to

Keyboard shortcuts

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