typex

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NotFound = new(struct{})

Functions

func ObjOf

func ObjOf(s1 interface{}, ss ...interface{}) []interface{}

ObjOf object slice

func StrOf

func StrOf(s1 string, ss ...string) []string

StrOf string slice

func ValueOf

func ValueOf(s1 reflect.Value, ss ...reflect.Value) []reflect.Value

Types

type A

type A []interface{}

An A is an ordered representation of a BSON array.

Example usage:

typex.A{"bar", "world", 3.14159, typex.D{{"qux", 12345}}}

func (*A) Append

func (a *A) Append(data ...interface{})

type CMap

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

func (*CMap) Del

func (t *CMap) Del(key string)

func (*CMap) Get

func (t *CMap) Get(key string) interface{}

func (*CMap) GetSet

func (t *CMap) GetSet(key string, val interface{}) (interface{}, bool)

func (*CMap) Has

func (t *CMap) Has(key string) bool

func (*CMap) Keys

func (t *CMap) Keys() []string

func (*CMap) Set

func (t *CMap) Set(key string, val interface{})

type Command

type Command = cli.Command

type Commands

type Commands = []cli.Command

type D

type D []Kv

func (*D) Append

func (d *D) Append(kv ...Kv)

func (D) Map

func (d D) Map() M

Map creates a map from the elements of the D.

type Flags

type Flags = []cli.Flag

type Kv

type Kv struct {
	K string      `json:"k"`
	V interface{} `json:"v"`
}

Kv represents a BSON element for a D. It is usually used inside a D.

func KvOf

func KvOf(k string, v interface{}) Kv

func (Kv) Map

func (kv Kv) Map() M

type M

type M = map[string]interface{}

type Map

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

func (*Map) Del

func (t *Map) Del(key string)

func (*Map) Each

func (t *Map) Each(fn func(name string, val interface{}))

func (*Map) Get

func (t *Map) Get(key string) interface{}

func (*Map) Has

func (t *Map) Has(key string) bool

func (*Map) Keys

func (t *Map) Keys() []string

func (*Map) Load

func (t *Map) Load(key string) (interface{}, bool)

func (*Map) Map

func (t *Map) Map() map[string]interface{}

func (*Map) Set

func (t *Map) Set(key string, val interface{})

type PriorityQueue

type PriorityQueue []*PriorityQueueItem

PriorityQueue implements the heap.Interface.

func (*PriorityQueue) Head

func (pq *PriorityQueue) Head() *PriorityQueueItem

Head returns the first item of a PriorityQueue without removing it.

func (PriorityQueue) Len

func (pq PriorityQueue) Len() int

Len returns the PriorityQueue length.

func (PriorityQueue) Less

func (pq PriorityQueue) Less(i, j int) bool

Less is the items less comparator.

func (*PriorityQueue) Pop

func (pq *PriorityQueue) Pop() interface{}

Pop implements the heap.Interface.Pop. Removes and returns element Len() - 1.

func (*PriorityQueue) PopItem

func (pq *PriorityQueue) PopItem() *PriorityQueueItem

func (*PriorityQueue) Push

func (pq *PriorityQueue) Push(x interface{})

Push implements the heap.Interface.Push. Adds x as element Len().

func (*PriorityQueue) PushItem

func (pq *PriorityQueue) PushItem(x *PriorityQueueItem)

func (*PriorityQueue) Remove

func (pq *PriorityQueue) Remove(i int) interface{}

Remove removes and returns the element at Index i from the PriorityQueue.

func (PriorityQueue) Swap

func (pq PriorityQueue) Swap(i, j int)

Swap exchanges the indexes of the items.

type PriorityQueueItem

type PriorityQueueItem struct {
	Value    interface{}
	Priority int64
	Index    int
}

type Queue

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

func QueueOf

func QueueOf(val ...interface{}) *Queue

func (*Queue) Del

func (t *Queue) Del(index uint32)

func (*Queue) First

func (t *Queue) First() interface{}

func (*Queue) Get

func (t *Queue) Get(index uint32) interface{}

func (*Queue) Last

func (t *Queue) Last() interface{}

func (*Queue) List

func (t *Queue) List() []interface{}

func (*Queue) Pop

func (t *Queue) Pop() interface{}

func (*Queue) PopFirst

func (t *Queue) PopFirst() interface{}

func (*Queue) Push

func (t *Queue) Push(val interface{})

type RwMap

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

func (*RwMap) Del

func (t *RwMap) Del(key string)

func (*RwMap) Each

func (t *RwMap) Each(fn func(name string, val interface{}))

func (*RwMap) Get

func (t *RwMap) Get(key string) interface{}

func (*RwMap) Has

func (t *RwMap) Has(key string) bool

func (*RwMap) Keys

func (t *RwMap) Keys() []string

func (*RwMap) Load

func (t *RwMap) Load(key string) (interface{}, bool)

func (*RwMap) Map

func (t *RwMap) Map() map[string]interface{}

func (*RwMap) Range

func (t *RwMap) Range(fn func(name string, val interface{}) bool)

func (*RwMap) Set

func (t *RwMap) Set(key string, val interface{})

type SMap

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

func (*SMap) Delete

func (t *SMap) Delete(key interface{})

func (*SMap) Each

func (t *SMap) Each(fn interface{}) (err error)

func (*SMap) Get

func (t *SMap) Get(key interface{}) interface{}

func (*SMap) Has

func (t *SMap) Has(key interface{}) (ok bool)

func (*SMap) Load

func (t *SMap) Load(key interface{}) (value interface{}, ok bool)

func (*SMap) LoadAndDelete

func (t *SMap) LoadAndDelete(key interface{}) (value interface{}, ok bool)

func (*SMap) Map

func (t *SMap) Map(fn func(val interface{}) interface{})

func (*SMap) MapTo

func (t *SMap) MapTo(data interface{}) (err error)

func (*SMap) Range

func (t *SMap) Range(f func(key, value interface{}) bool)

func (*SMap) Set

func (t *SMap) Set(key, value interface{})

type Set

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

func SetOf

func SetOf(val ...interface{}) *Set

func (*Set) Add

func (t *Set) Add(v interface{})

func (*Set) Each

func (t *Set) Each(fn interface{})

func (*Set) Has

func (t *Set) Has(v interface{}) bool

func (*Set) Len

func (t *Set) Len() uint32

func (*Set) List

func (t *Set) List() (val []interface{})

func (*Set) Map

func (t *Set) Map(data interface{}) (err error)

Jump to

Keyboard shortcuts

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