protocol

package
v1.19.2 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ViperDecoderHook added in v1.11.3

func ViperDecoderHook() libmap.DecodeHookFuncType

Types

type NetworkProtocol

type NetworkProtocol uint8
const (
	NetworkEmpty NetworkProtocol = iota
	NetworkUnix
	NetworkTCP
	NetworkTCP4
	NetworkTCP6
	NetworkUDP
	NetworkUDP4
	NetworkUDP6
	NetworkIP
	NetworkIP4
	NetworkIP6
	NetworkUnixGram
)

func Parse

func Parse(str string) NetworkProtocol

func ParseBytes

func ParseBytes(p []byte) NetworkProtocol

func ParseInt64 added in v1.11.3

func ParseInt64(val int64) NetworkProtocol

func ParseUint64 added in v1.19.0

func ParseUint64(val uint64) NetworkProtocol

func (NetworkProtocol) Code

func (n NetworkProtocol) Code() string

Code returns a string representation of the NetworkProtocol as a code. The returned string is equal to the value returned by String(). This function is alias of String to be consistently with other custom const type.

func (NetworkProtocol) Int added in v1.19.0

func (n NetworkProtocol) Int() int

Int returns the NetworkProtocol as an int value. If the NetworkProtocol is found, the corresponding int value is returned. Otherwise, the return int value is zero.

func (NetworkProtocol) Int64 added in v1.19.0

func (n NetworkProtocol) Int64() int64

Int64 returns the NetworkProtocol as an int64 value. If the NetworkProtocol is found, the corresponding int64 value is returned. Otherwise, the return int64 value is zero.

func (NetworkProtocol) IsTCP added in v1.19.0

func (n NetworkProtocol) IsTCP() bool

func (NetworkProtocol) IsUDP added in v1.19.0

func (n NetworkProtocol) IsUDP() bool

func (NetworkProtocol) IsUnixLike added in v1.19.0

func (n NetworkProtocol) IsUnixLike() bool

func (NetworkProtocol) MarshalCBOR

func (n NetworkProtocol) MarshalCBOR() ([]byte, error)

func (NetworkProtocol) MarshalJSON

func (n NetworkProtocol) MarshalJSON() ([]byte, error)

func (NetworkProtocol) MarshalTOML

func (n NetworkProtocol) MarshalTOML() ([]byte, error)

func (NetworkProtocol) MarshalText

func (n NetworkProtocol) MarshalText() ([]byte, error)

func (NetworkProtocol) MarshalYAML

func (n NetworkProtocol) MarshalYAML() (interface{}, error)

func (NetworkProtocol) String

func (n NetworkProtocol) String() string

String returns a string representation of the NetworkProtocol. If the NetworkProtocol is found, the corresponding string value is returned. Otherwise, the return string is empty

func (NetworkProtocol) Uint added in v1.19.0

func (n NetworkProtocol) Uint() uint

Uint returns the NetworkProtocol as an uint value. If the NetworkProtocol is found, the corresponding uint value is returned. Otherwise, the return uint value is zero.

func (NetworkProtocol) Uint64 added in v1.19.0

func (n NetworkProtocol) Uint64() uint64

Uint64 returns the NetworkProtocol as a uint64 value. If the NetworkProtocol is found, the corresponding uint64 value is returned. Otherwise, the return uint64 value is zero.

func (*NetworkProtocol) UnmarshalCBOR

func (n *NetworkProtocol) UnmarshalCBOR(bytes []byte) error

func (*NetworkProtocol) UnmarshalJSON

func (n *NetworkProtocol) UnmarshalJSON(bytes []byte) error

func (*NetworkProtocol) UnmarshalTOML

func (n *NetworkProtocol) UnmarshalTOML(i interface{}) error

func (*NetworkProtocol) UnmarshalText

func (n *NetworkProtocol) UnmarshalText(bytes []byte) error

func (*NetworkProtocol) UnmarshalYAML

func (n *NetworkProtocol) UnmarshalYAML(value *yaml.Node) error

Jump to

Keyboard shortcuts

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