util

package
v2.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HTTPConnInfoHint = hint.MustNewHint("http-conninfo-v0.0.1")
)

Functions

func CheckBindIsOpen

func CheckBindIsOpen(network, bind string, timeout time.Duration) error

func CopyBytes

func CopyBytes(b []byte) []byte

func GenerateChecksum

func GenerateChecksum(i io.Reader) (string, error)

func GenerateFileChecksum

func GenerateFileChecksum(p string) (string, error)

func IsValidURL

func IsValidURL(u *url.URL) error

func NormalizeURL

func NormalizeURL(u *url.URL) *url.URL

func NormalizeURLString

func NormalizeURLString(s string) (*url.URL, error)

func ParseCombinedNodeURL

func ParseCombinedNodeURL(u *url.URL) (*url.URL, bool, error)

ParseCombinedNodeURL parses the combined url of node; it contains, - node publish url - tls insecure: "#insecure" "insecure" fragment will be removed.

func ParseURL

func ParseURL(s string, allowEmpty bool) (*url.URL, error)

Types

type BSONFilter

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

func EmptyBSONFilter

func EmptyBSONFilter() *BSONFilter

func NewBSONFilter

func NewBSONFilter(key string, value interface{}) *BSONFilter

func NewBSONFilterFromD

func NewBSONFilterFromD(d bson.D) *BSONFilter

func (*BSONFilter) Add

func (ft *BSONFilter) Add(key string, value interface{}) *BSONFilter

func (*BSONFilter) AddOp

func (ft *BSONFilter) AddOp(key string, value interface{}, op string) *BSONFilter

func (*BSONFilter) D

func (ft *BSONFilter) D() bson.D

type BaseHinter

type BaseHinter struct {
	HT hint.Hint `bson:"_hint"` //nolint:tagliatelle //...
}

func NewBaseHinter

func NewBaseHinter(ht hint.Hint) BaseHinter

func (BaseHinter) Bytes

func (ht BaseHinter) Bytes() []byte

func (BaseHinter) Hint

func (ht BaseHinter) Hint() hint.Hint

func (BaseHinter) IsValid

func (ht BaseHinter) IsValid(expectedType []byte) error

func (BaseHinter) SetHint

func (BaseHinter) SetHint(n hint.Hint) hint.Hinter

type Byter

type Byter interface {
	Bytes() []byte
}

func NewByter

func NewByter(b []byte) Byter

type HTTPConnInfo

type HTTPConnInfo struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

func NewHTTPConnInfo

func NewHTTPConnInfo(u *url.URL, insecure bool) HTTPConnInfo

func NewHTTPConnInfoFromString

func NewHTTPConnInfoFromString(s string, insecure bool) (HTTPConnInfo, error)

func (HTTPConnInfo) Bytes

func (conn HTTPConnInfo) Bytes() []byte

func (HTTPConnInfo) Insecure

func (conn HTTPConnInfo) Insecure() bool

func (HTTPConnInfo) IsValid

func (conn HTTPConnInfo) IsValid([]byte) error

func (HTTPConnInfo) SetInsecure

func (conn HTTPConnInfo) SetInsecure(i bool) HTTPConnInfo

func (HTTPConnInfo) String

func (conn HTTPConnInfo) String() string

func (HTTPConnInfo) URL

func (conn HTTPConnInfo) URL() *url.URL

Directories

Path Synopsis
Package bsonenc support encoding and decoding by bson.
Package bsonenc support encoding and decoding by bson.

Jump to

Keyboard shortcuts

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