interfaces

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Migration

type Migration interface {

	/*
		Migrate migrates the module.
	*/
	Migrate() error
}

Migration defines an interface for performing migration on nested modules.

type Url

type Url interface {

	/*
		Use Validator interface.
	*/
	Validator

	/*
		Clean cleans up this Url struct.
	*/
	Clean()

	/*
		IsEmpty returns whether this Url is practically unusable.
	*/
	IsEmpty() bool

	/*
		Hostname returns this Url hostname.
	*/
	Hostname() string

	/*
		Path returns this Url path.
	*/
	Path() string

	/*
		HostPathConcat returns a concatenation of host, port and path.
	*/
	HostPathConcat() string

	/*
		HostPathConcat returns a concatenation of host, port and path with stricter output rules.
	*/
	HostPathConcatStrict() string

	/*
		String ensures the implementation of the Stringer interface.
		Provides a string representation of this Url.
	*/
	String() string

	/*
		UnmarshalText ensures the implementation of encoding.TextUnmarshaler interface.
		Unmarshals an Url struct from a slice of bytes.
	*/
	UnmarshalText(text []byte) error

	/*
		MarshalText ensures the implementation of encoding.TextMarshaler interface.
		Marshals this Url struct back into a slice of bytes.
	*/
	MarshalText() ([]byte, error)
}

Url defines functions every Url-model should implement.

type Validator

type Validator interface {

	/*
		Validate cleans and validates the underlying data structure and returns an error if anything is invalid.
	*/
	Validate() error
}

Validator is an interface that provide a Validate() function.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳