util

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MessageEntry

func MessageEntry(nodeID string, args ...string) *log.Entry

MessageEntry returns a log Entry with additional fields containing request metadata

func NodeEntry

func NodeEntry(nodeID string) *log.Entry

NodeEntry returns a log Entry with additional fields containing the given node metadata

func ReadBool

func ReadBool(reader io.Reader) (bool, error)

ReadBool reads a boolean from the given reader

func ReadBytes

func ReadBytes(reader io.Reader) ([]byte, error)

ReadBytes reads a byte slice from the given reader

func ReadMap

func ReadMap(reader io.Reader, m interface{}, f interface{}) error

ReadMap reads a map from the given reader

func ReadSlice

func ReadSlice(reader io.Reader, s interface{}, f interface{}) error

ReadSlice reads a fixed length slice from the given reader

func ReadValue

func ReadValue(reader io.Reader, f interface{}) (interface{}, error)

ReadValue reads a value from the given reader

func ReadVarInt

func ReadVarInt(reader io.Reader) (int, error)

ReadVarInt reads a signed integer from the given reader

func ReadVarInt32

func ReadVarInt32(reader io.Reader) (int32, error)

ReadVarInt32 reads a signed 32-bit integer from the given reader

func ReadVarInt64

func ReadVarInt64(reader io.Reader) (int64, error)

ReadVarInt64 reads a signed variable length integer from the given reader

func ReadVarUint

func ReadVarUint(reader io.Reader) (uint, error)

ReadVarUint reads an unsigned integer from the given reader

func ReadVarUint32

func ReadVarUint32(reader io.Reader) (uint32, error)

ReadVarUint32 reads an unsigned 32-bit integer from the given reader

func ReadVarUint64

func ReadVarUint64(reader io.Reader) (uint64, error)

ReadVarUint64 reads an unsigned variable length integer from the given reader

func RequestEntry

func RequestEntry(nodeID string, args ...string) *log.Entry

RequestEntry returns a log Entry with additional fields containing request metadata

func ResponseEntry

func ResponseEntry(nodeID string, args ...string) *log.Entry

ResponseEntry returns a log Entry with additional fields containing response metadata

func ServiceEntry

func ServiceEntry(nodeID string, serviceNamespace string, serviceName string, sessionID uint64) *log.Entry

ServiceEntry returns a log Entry with additional fields containing the given service metadata

func SessionEntry

func SessionEntry(nodeID string, sessionID uint64) *log.Entry

SessionEntry returns a log Entry with additional fields containing the given session metadata

func StreamEntry

func StreamEntry(nodeID string, sessionID uint64, streamID uint64) *log.Entry

StreamEntry returns a log Entry with additional fields containing the given stream metadata

func WriteBool

func WriteBool(writer io.Writer, b bool) error

WriteBool writes a boolean to the given writer

func WriteBytes

func WriteBytes(writer io.Writer, bytes []byte) error

WriteBytes writes a byte slice to the given writer

func WriteMap

func WriteMap(writer io.Writer, m interface{}, f interface{}) error

WriteMap writes a map to the given writer

func WriteSlice

func WriteSlice(writer io.Writer, s interface{}, f interface{}) error

WriteSlice writes a slice the the given writer

func WriteValue

func WriteValue(writer io.Writer, value interface{}, f interface{}) error

WriteValue writes the given value to the given writer

func WriteVarInt

func WriteVarInt(writer io.Writer, i int) error

WriteVarInt writes a signed integer to the given writer

func WriteVarInt32

func WriteVarInt32(writer io.Writer, i int32) error

WriteVarInt32 writes a signed 32-bit integer to the given writer

func WriteVarInt64

func WriteVarInt64(writer io.Writer, x int64) error

WriteVarInt64 writes a signed variable length integer to the given writer

func WriteVarUint

func WriteVarUint(writer io.Writer, i uint) error

WriteVarUint writes an unsigned integer to the given writer

func WriteVarUint32

func WriteVarUint32(writer io.Writer, i uint32) error

WriteVarUint32 writes an unsigned 32-bit integer to the given writer

func WriteVarUint64

func WriteVarUint64(writer io.Writer, x uint64) error

WriteVarUint64 writes an unsigned variable length integer to the given writer

Types

type Ready

type Ready interface {
	// Set ensures that future readiness probes will indicate that the operator
	// is ready.
	Set() error

	// Unset ensures that future readiness probes will indicate that the
	// operator is not ready.
	Unset() error
}

Ready holds state about whether the operator is ready and communicates that to a Kubernetes readiness probe.

func NewFileReady

func NewFileReady() Ready

NewFileReady returns a Ready that uses the presence of a file on disk to communicate whether the operator is ready. The operator's Pod definition should include a readinessProbe of "exec" type that calls "stat /tmp/operator-sdk-ready".

Jump to

Keyboard shortcuts

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