libraries

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure(config LogConfig) *Logger

func ConnectToPaypal

func ConnectToPaypal()

func Consume

func Consume(queue string)

func CreateOrder

func CreateOrder(o *models.Payment, user *models.User) error

func Decrypt

func Decrypt(encryptedString string, keyString string) (decryptedString string)

func Encrypt

func Encrypt(stringToEncrypt string, keyString string) (encryptedString string)

func GetOrder

func GetOrder(id string) (*paypal.Order, error)

func Publish

func Publish(queue string, payload interface{})

func SetupQueue

func SetupQueue() *amqp.Connection

func SetupZeroLog

func SetupZeroLog() *Logger

Types

type LogConfig

type LogConfig struct {
	// Enable console logging
	ConsoleLoggingEnabled bool

	// EncodeLogsAsJson makes the log framework log JSON
	EncodeLogsAsJson bool
	// FileLoggingEnabled makes the framework log to a file
	// the fields below can be skipped if this value is false!
	FileLoggingEnabled bool
	// Directory to log to to when filelogging is enabled
	Directory string
	// Filename is the name of the logfile which will be placed inside the directory
	Filename string
	// MaxSize the max size in MB of the logfile before it's rolled
	MaxSize int
	// MaxBackups the max number of rolled files to keep
	MaxBackups int
	// MaxAge the max age in days to keep a logfile
	MaxAge int
}

Configuration for logging

type LogFields

type LogFields struct {
	RequestID  string
	RemoteIP   string
	Host       string
	Method     string
	Path       string
	Protocol   string
	StatusCode int
	Latency    float64
	Error      error
	Stack      []byte
}

func (*LogFields) MarshalZerologObject

func (lf *LogFields) MarshalZerologObject(e *zerolog.Event)

type Order

type Order struct {
	InvoiceID         string
	Amount            string
	Currency          string
	PayPalOrderDetail *paypal.Order
	OrderUrl          string
}

type URL

type URL struct {
	App *fiber.App
	Ctx *fiber.Ctx
}

func (*URL) SignedUrl

func (u *URL) SignedUrl(path string, config URLConfig) string

func (*URL) TemporarySignedUrl

func (u *URL) TemporarySignedUrl(path string, config URLConfig) string

func (*URL) TemporaryUrl

func (u *URL) TemporaryUrl(path string, config URLConfig) string

type URLConfig

type URLConfig struct {
	Expire    time.Duration //nolint:gofmt
	Lookup    func(interface{}) string
	AllowOnce bool
}

Jump to

Keyboard shortcuts

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