util

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaulCmdTimeout = time.Minute // one minute by default

	GRPCHealthProbe = "/usr/local/bin/grpc_health_probe"
)
View Source
const (
	LogComponentField = "component"
)

Variables

This section is empty.

Functions

func Execute

func Execute(binary string, args ...string) (string, error)

func ExecuteWithTimeout

func ExecuteWithTimeout(timeout time.Duration, binary string, args ...string) (string, error)

func GRPCServiceReadinessProbe

func GRPCServiceReadinessProbe(address string) bool

func GetURL

func GetURL(host string, port int) string

func PrintJSON

func PrintJSON(obj interface{}) error

func RemoveFile

func RemoveFile(file string) error

func SetUpLogger

func SetUpLogger(logsDir string) error

Types

type Bitmap

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

func NewBitmap

func NewBitmap(start, end int32) *Bitmap

NewBitmap allocate a bitmap range from [start, end], notice the end is included

func (*Bitmap) AllocateRange

func (b *Bitmap) AllocateRange(count int32) (int32, int32, error)

func (*Bitmap) ReleaseRange

func (b *Bitmap) ReleaseRange(start, end int32) error

type LonghornFormatter

type LonghornFormatter struct {
	*logrus.TextFormatter

	LogsDir string
	// contains filtered or unexported fields
}

func (LonghornFormatter) Format

func (l LonghornFormatter) Format(entry *logrus.Entry) ([]byte, error)

type LonghornWriter

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

func NewLonghornWriter

func NewLonghornWriter(name string, logsDir string) (*LonghornWriter, error)

func (LonghornWriter) Close

func (l LonghornWriter) Close() error

func (LonghornWriter) StreamLog

func (l LonghornWriter) StreamLog(done chan struct{}) (chan string, error)

func (LonghornWriter) Write

func (l LonghornWriter) Write(input []byte) (int, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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