chartmuseum

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2018 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	*zap.SugaredLogger
}

Logger handles all logging from application

func NewLogger

func NewLogger(json bool, debug bool) (*Logger, error)

NewLogger creates a new Logger instance

func (*Logger) Debugc added in v0.2.6

func (logger *Logger) Debugc(c *gin.Context, msg string, keysAndValues ...interface{})

Debugc wraps Debugw provided by zap, adding data from gin request context

func (*Logger) Errorc added in v0.2.6

func (logger *Logger) Errorc(c *gin.Context, msg string, keysAndValues ...interface{})

Errorc wraps Errorw provided by zap, adding data from gin request context

func (*Logger) Infoc added in v0.2.6

func (logger *Logger) Infoc(c *gin.Context, msg string, keysAndValues ...interface{})

Infoc wraps Infow provided by zap, adding data from gin request context

func (*Logger) Warnc added in v0.2.6

func (logger *Logger) Warnc(c *gin.Context, msg string, keysAndValues ...interface{})

Warnc wraps Warnw provided by zap, adding data from gin request context

type Router

type Router struct {
	*gin.Engine
}

Router handles all incoming HTTP requests

func NewRouter

func NewRouter(logger *Logger, enableMetrics bool) *Router

NewRouter creates a new Router instance

type Server

type Server struct {
	Logger                 *Logger
	Router                 *Router
	RepositoryIndex        *repo.Index
	StorageBackend         storage.Backend
	StorageCache           []storage.Object
	AllowOverwrite         bool
	AnonymousGet           bool
	TlsCert                string
	TlsKey                 string
	ChartPostFormFieldName string
	ProvPostFormFieldName  string
	IndexLimit             int
	// contains filtered or unexported fields
}

Server contains a Logger, Router, storage backend and object cache

func NewServer

func NewServer(options ServerOptions) (*Server, error)

NewServer creates a new Server instance

func (*Server) Listen

func (server *Server) Listen(port int)

Listen starts server on a given port

type ServerOptions

type ServerOptions struct {
	StorageBackend         storage.Backend
	LogJSON                bool
	Debug                  bool
	EnableAPI              bool
	AllowOverwrite         bool
	EnableMetrics          bool
	AnonymousGet           bool
	ChartURL               string
	TlsCert                string
	TlsKey                 string
	Username               string
	Password               string
	ChartPostFormFieldName string
	ProvPostFormFieldName  string
	IndexLimit             int
	ContextPath            string
}

ServerOptions are options for constructing a Server

Jump to

Keyboard shortcuts

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