process

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: Apache-2.0 Imports: 19 Imported by: 16

Documentation

Index

Constants

View Source
const (
	HTTPChainAuth        = "auth"
	HTTPChainRateLimiter = "rateLimiter"
)

Variables

This section is empty.

Functions

func CPUSetParse

func CPUSetParse(s string) (sets.Int, error)

CPUSetParse constructs an integer cpu set from a Linux CPU list formatted string. See: http://man7.org/linux/man-pages/man7/cpuset.7.html#FORMATS

func Dial

func Dial(unixSocketPath string, timeout time.Duration) (*grpc.ClientConn, error)

func GetAndUnmarshal

func GetAndUnmarshal(url string, v interface{}) error

GetAndUnmarshal gets data from the given url and unmarshal it into the given struct.

func NewDefaultHTTPClient

func NewDefaultHTTPClient() *http.Client

NewDefaultHTTPClient returns a raw HTTP client.

func SetupSignalHandler

func SetupSignalHandler() context.Context

SetupSignalHandler registered for SIGTERM and SIGINT. A stop channel is returned which is closed on one of these signals. If a second signal is caught, the program is terminated with exit code 1.

Types

type GetAuthPair

type GetAuthPair func() (map[string]string, error)

GetAuthPair is a uniformed helper function to get auth pair maps (user:passwd)

type HTTPHandler

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

func NewHTTPHandler

func NewHTTPHandler(authFun GetAuthPair, enabled []string) *HTTPHandler

func (*HTTPHandler) Run

func (h *HTTPHandler) Run(ctx context.Context)

func (*HTTPHandler) WithHandleChain

func (h *HTTPHandler) WithHandleChain(f http.Handler) http.Handler

WithHandleChain builds handler chains for http.Handler

type StopControl

type StopControl struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewStopControl

func NewStopControl(stopTime time.Time) *StopControl

func (*StopControl) IsStopped

func (sc *StopControl) IsStopped() bool

func (*StopControl) Stop

func (sc *StopControl) Stop()

func (*StopControl) StopGracePeriodExpired

func (sc *StopControl) StopGracePeriodExpired() bool

Jump to

Keyboard shortcuts

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