server

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoDropLogger added in v0.1.1

type GoDropLogger interface {
	StdLogger
	Error(v ...interface{})
	Errorf(format string, v ...interface{})
	Errorln(v ...interface{})
}

GoDropLogger describes a logger that is based on the StdLogger but provides some additional utility methods used by GoDrop. A StdLogger can be wrapped using NewLogger.

func DefaultLogger added in v0.1.1

func DefaultLogger() GoDropLogger

DefaultLogger just returns a new GoDropLogger based on log.Default.

func NewLogger added in v0.1.1

func NewLogger(stdLogger StdLogger) GoDropLogger

NewLogger can wrap a StdLogger and just adds some more utility methods needed by the GoDropLogger. It can be used with any standard-lib compatible logger.

type Server added in v0.1.1

type Server struct {
	Host           string
	AllowedOrigins []string
	Repos          *provider.Repositories
	Logger         GoDropLogger
	// contains filtered or unexported fields
}

func (*Server) Init added in v0.1.1

func (s *Server) Init() *chi.Mux

func (*Server) Run added in v0.1.1

func (s *Server) Run()

type StdLogger added in v0.1.1

type StdLogger interface {
	Print(...interface{})
	Printf(string, ...interface{})
	Println(...interface{})

	Fatal(...interface{})
	Fatalf(string, ...interface{})
	Fatalln(...interface{})

	Panic(...interface{})
	Panicf(string, ...interface{})
	Panicln(...interface{})
}

StdLogger describes a logger that is compatible with the standard log.Logger but also logrus and others. As not to limit which loggers can and can't be used with the API.

This interface is from https://godoc.org/github.com/Sirupsen/logrus#StdLogger

Directories

Path Synopsis
dto

Jump to

Keyboard shortcuts

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