fields

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TimeFromString

func TimeFromString(s string) (time.Time, error)

TimeFromString returns a time.Time from a string. If the string is not a valid time, it returns an error. The string must be in RFC3339 format.

Types

type ErrInvalidHttpPort

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

ErrInvalidHttpPort is returned if the port number is invalid.

func (ErrInvalidHttpPort) Error

func (e ErrInvalidHttpPort) Error() string

Error returns the error message.

type ErrInvalidPath

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

ErrInvalidPath is returned if the path is invalid.

func (ErrInvalidPath) Error

func (e ErrInvalidPath) Error() string

Error returns the error message.

type ErrRequiredStringEmpty

type ErrRequiredStringEmpty struct{}

ErrRequiredStringEmpty is returned if the string is empty.

func (ErrRequiredStringEmpty) Error

func (e ErrRequiredStringEmpty) Error() string

Error returns the error message.

type HttpPort

type HttpPort int

HttpPort represents a port number. The port number must be between 0 and 65535.

func HttpPortFromInt

func HttpPortFromInt(port int) (HttpPort, error)

HttpPortFromInt returns a HttpPort from an int. If the port number is invalid, it returns an error. The port number must be between 0 and 65535.

func HttpPortFromString

func HttpPortFromString(port string) (HttpPort, error)

HttpPortFromString returns a HttpPort from a string. If the port number is invalid, it returns an error. The port number must be between 0 and 65535.

func MustHttpPortFromInt

func MustHttpPortFromInt(port int) HttpPort

MustHttpPortFromInt returns a HttpPort from an int. If the port number is invalid, it panics.

func MustHttpPortFromString

func MustHttpPortFromString(port string) HttpPort

MustHttpPortFromString returns a HttpPort from a string. If the port number is invalid, it panics.

type Path

type Path string

Path represents a path.

func MustPathFromString

func MustPathFromString(s string) Path

MustPathFromString returns a Path from a string. If the path is invalid, it panics.

func PathFromString

func PathFromString(s string) (Path, error)

PathFromString returns a Path from a string. If the path is invalid, it returns an error.

func (Path) File

func (p Path) File() (*os.File, error)

File opens the file and returns a file handle if the path is a file.

func (Path) Join

func (p Path) Join(elem ...string) (Path, error)

Join joins the path with the given elements.

func (Path) String

func (p Path) String() string

String returns the path as a string.

type RequiredString

type RequiredString string

RequiredString represents a string that is required. The string must not be empty.

func MustRequiredStringFromString

func MustRequiredStringFromString(s string) RequiredString

MustRequiredStringFromString returns a RequiredString from a string. If the string is empty, it panics.

func RequiredStringFromString

func RequiredStringFromString(s string) (RequiredString, error)

RequiredStringFromString returns a RequiredString from a string. If the string is empty, it returns an error.

Jump to

Keyboard shortcuts

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