infra

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// AllLevels list containing all the possible log levels
	AllLevels = []string{seelog.TraceStr, seelog.DebugStr, seelog.InfoStr, seelog.WarnStr, seelog.ErrorStr, seelog.CriticalStr, seelog.OffStr}
)
View Source
var CurrentLogOptions = &LogOptions{
	logLevelInt: seelog.DebugLvl,
	LogLevel:    seelog.DebugStr,
}

CurrentLogOptions current seelog options

Functions

func BootstrapLogger

func BootstrapLogger(opts *LogOptions)

BootstrapLogger loads seelog package into the overall system

func ConfigureLogger

func ConfigureLogger(level string)

ConfigureLogger configures options using parsed flag values

Types

type LogOptions

type LogOptions struct {
	LogLevel string
	// contains filtered or unexported fields
}

LogOptions seelog options

type Ping

type Ping struct {
	// example: pong
	Message string `json:"message"`
}

Ping represents ping response swagger:model

type PingEndpoint

type PingEndpoint struct {
}

PingEndpoint responds to ping

func NewPingEndpoint

func NewPingEndpoint() *PingEndpoint

NewPingEndpoint creates ping endpoint

func (*PingEndpoint) Ping

func (p *PingEndpoint) Ping(c *gin.Context)

Ping responds to ping swagger:operation GET /ping ping --- summary: Responds to ping responses:

'200':
  description: Ping successful
  schema:
    "$ref": "#/definitions/Ping"

func (*PingEndpoint) RegisterRoutes

func (p *PingEndpoint) RegisterRoutes(r gin.IRoutes)

RegisterRoutes registers ping route

type RateLimiter

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

RateLimiter limits requests to certain endpoints

func NewRateLimiter

func NewRateLimiter(requestsPerSecond float64) *RateLimiter

NewRateLimiter creates a new RateLimiter

func (*RateLimiter) Handler

func (r *RateLimiter) Handler() gin.HandlerFunc

Handler returns handler func for gin

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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