utils

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeBase64String

func DecodeBase64String(in string) (out []byte, err error)

DecodeBase64String is a flexible base64 decoder that supports both standard and url encodings, and considers padding optional

func FileExists

func FileExists(path string) (bool, error)

FileExists returns true if a file exists on disk and is a regular file

func IsTruthy

func IsTruthy(str string) bool

IsTruthy returns true if a string is truthy, such as "1", "on", "yes", "true", "t", "y"

Types

type Service added in v1.2.0

type Service func(ctx context.Context) error

Service is a background service

type ServiceRunner added in v1.2.0

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

ServiceRunner oversees a number of services running in background

func NewServiceRunner added in v1.2.0

func NewServiceRunner(services ...Service) *ServiceRunner

NewServiceRunner creates a new ServiceRunner

func (*ServiceRunner) Add added in v1.2.0

func (r *ServiceRunner) Add(service ...Service)

Add a service

func (*ServiceRunner) Run added in v1.2.0

func (r *ServiceRunner) Run(ctx context.Context) error

Run all background services

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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