data

package
v0.0.0-...-c18a219 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: MIT Imports: 2 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Empty is a empty struct instance.
	Empty             = struct{}{}
	Nil         Value = nilValue{}
	ErrNilValue       = errors.New("nil value")
)

Functions

This section is empty.

Types

type Chan

type Chan chan struct{}

Chan is a simple notification channel

func (Chan) ReadOnly

func (c Chan) ReadOnly() ReadChan

ReadOnly converts c to receive-only channel

func (Chan) Receive

func (c Chan) Receive()

Receive receives a notification from channel. It blocks if channel is empty.

func (Chan) Send

func (c Chan) Send()

Send sends a notification to channel. It blocks if channel is full.

func (Chan) TryReceive

func (c Chan) TryReceive() bool

TryReceive receives a notification from channel. It returns false if channel is empty.

func (Chan) TrySend

func (c Chan) TrySend() bool

TrySend sends a notification to channel. It returns false if channel is full.

func (Chan) WriteOnly

func (c Chan) WriteOnly() WriteChan

WriteOnly converts c to send-only channel

type Map

type Map map[string]interface{}

func (Map) Contains

func (m Map) Contains(key string) bool

func (Map) Cover

func (m Map) Cover(src Map)

Cover merges and replaces all key-value pairs of src into m

func (Map) Find

func (m Map) Find(key string) interface{}

func (Map) Get

func (m Map) Get(key string) interface{}

func (Map) Keys

func (m Map) Keys() []string

func (Map) Merge

func (m Map) Merge(src Map)

Merge merges all key-value pairs of src into m.

func (Map) Remove

func (m Map) Remove(key string)

func (Map) Set

func (m Map) Set(key string, value interface{}) Map

func (Map) TryGet

func (m Map) TryGet(key string) (v interface{}, ok bool)

type Option

type Option struct {
	Name  string `json:"name" xml:"name,attr"`
	Value string `json:"value" xml:"value,attr"`
}

func ParseOption

func ParseOption(s, sep string) Option

type Options

type Options []Option

func ParseOptions

func ParseOptions(s, sep1, sep2 string) Options

func (Options) Get

func (opts Options) Get(name string) string

type ReadChan

type ReadChan <-chan struct{}

ReadChan is a receive-only notification channel

func (ReadChan) Receive

func (c ReadChan) Receive()

Receive receives a notification from channel. It blocks if channel is empty.

func (ReadChan) TryReceive

func (c ReadChan) TryReceive() bool

TryReceive receives a notification from channel. It returns false if channel is empty.

type Value

type Value interface {
	IsNil() bool
	Scan(i interface{}) error
	Bytes() ([]byte, error)
	Bool() (bool, error)
	String() (string, error)
	Int() (int, error)
	Int8() (int8, error)
	Int16() (int16, error)
	Int32() (int32, error)
	Int64() (int64, error)
	Uint() (uint, error)
	Uint8() (uint8, error)
	Uint16() (uint16, error)
	Uint32() (uint32, error)
	Uint64() (uint64, error)
	Float32() (float32, error)
	Float64() (float64, error)
}

type WriteChan

type WriteChan chan<- struct{}

WriteChan is a send-only notification channel

func (WriteChan) Send

func (c WriteChan) Send()

Send sends a notification to channel. It blocks if channel is full.

func (WriteChan) TrySend

func (c WriteChan) TrySend() bool

TrySend sends a notification to channel. It returns false if channel is full.

Directories

Path Synopsis
Package guid is a globally unique id generator.
Package guid is a globally unique id generator.

Jump to

Keyboard shortcuts

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