util

package
v0.0.0-...-2f2c24c Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultLogger = NewZapLogger()

Functions

This section is empty.

Types

type Context

type Context interface {
	Cancel()
	Done() <-chan struct{}
}

func NewContext

func NewContext() Context

type DiContainer

type DiContainer interface {
	AddLifetime(dependency LifetimeDependency)
	Add(dependency any)
	AddInstance(dependency any)
	AddExecute(executable any)
	Run()
	Stop()
}

func NewDIContainer

func NewDIContainer(context Context) DiContainer

type HttpClient

type HttpClient interface {
	Get(url string) (string, error)
}

func NewHttpClient

func NewHttpClient() HttpClient

type LifetimeDependency

type LifetimeDependency interface {
	OnStart(ctx gocontext.Context) error
	OnStop(ctx gocontext.Context) error
}

type Logger

type Logger interface {
	Debug(args ...any)
	Debugf(format string, args ...any)

	Info(args ...any)
	Infof(format string, args ...any)

	Warn(args ...any)
	Warnf(format string, args ...any)

	Error(args ...any)
	Errorf(format string, args ...any)
}

func NewZapLogger

func NewZapLogger() Logger

type Pair

type Pair[F, S any] struct {
	First  F
	Second S
}

Jump to

Keyboard shortcuts

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