util

package
v0.0.0-...-44570ba Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: GPL-3.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorContainerNameNotFound = errors.New("container name not found")
View Source
var Logger *logrus.Logger

Functions

func BuildFishler

func BuildFishler(client *client.Client, ctx context.Context, forceBuild bool) error

func ByteCountDecimal

func ByteCountDecimal(b int64) string

func CleanIfContainerExists

func CleanIfContainerExists(ctx context.Context, client *client.Client, containerID string) error

func CreateRunWaitSSHContainer

func CreateRunWaitSSHContainer(createCfg *container.Config, hostCfg *container.HostConfig, networkCfg *network.NetworkingConfig, sess ssh.Session) (exitCode int64, cleanup func(), err error)

func GetContainerName

func GetContainerName(remoteIP string) string

func GetDockerImage

func GetDockerImage(client *client.Client, ctx context.Context) ([]types.ImageSummary, error)

func GetFishlerPrivateKey

func GetFishlerPrivateKey() (string, error)

func GetFishlerPrivateKeyPath

func GetFishlerPrivateKeyPath() string

func GetKeySigner

func GetKeySigner() (gossh.Signer, error)

func GetProfileBuffer

func GetProfileBuffer(username string) ([]byte, error)

func GetSessionFileName

func GetSessionFileName(basepath string, containerID string, sessionRemoteAddress net.Addr) string

func GetSessionVolumnDirectory

func GetSessionVolumnDirectory(basepath string, directory string, sessionRemoteAddress net.Addr) string

func SetLogger

func SetLogger(filepath string) *logrus.Logger

Types

type FormatterHook

type FormatterHook struct {
	Writer    io.Writer
	LogLevels []logrus.Level
	Formatter logrus.Formatter
}

FormatterHook is a hook that writes logs of specified LogLevels with a formatter to specified Writer

func (*FormatterHook) Fire

func (hook *FormatterHook) Fire(entry *logrus.Entry) error

Fire will be called when some logging function is called with current hook It will format log entry and write it to appropriate writer

func (*FormatterHook) Levels

func (hook *FormatterHook) Levels() []logrus.Level

Levels define on which log levels this hook would trigger

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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