lib

package
v0.0.0-...-8930a1b Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2017 License: Apache-2.0 Imports: 22 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 {

	// Location of the actual files.
	CacheDir string

	// TLS will be enabled if set.
	TLSCertsDir string

	// Path and name of the metadata database.
	DBFilename string

	ServerAddr string

	Hosts map[string]Host

	DefaultHostAccessKey string
	DefaultHostSecretKey string
	SecretKey            string
}

func LoadConfig

func LoadConfig(filename string) (Config, error)

func (Config) CreateLogger

func (c Config) CreateLogger() *Logger

type Host

type Host struct {
	Name   string
	Bucket string
	Path   string

	AccessKey string
	SecretKey string
}

type Logger

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

func NewLogger

func NewLogger(logger log.Logger) *Logger

func (*Logger) Debug

func (l *Logger) Debug(keyvals ...interface{}) error

func (*Logger) Error

func (l *Logger) Error(keyvals ...interface{}) error

func (*Logger) Info

func (l *Logger) Info(keyvals ...interface{}) error

type Server

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

Server represents the caching HTTP server.

func NewServer

func NewServer(cfg Config, logger *Logger) (*Server, error)

func (*Server) Serve

func (s *Server) Serve() error

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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