Documentation
¶
Index ¶
- Constants
- func ANYKEY[K comparable, V any](in map[K]V) K
- func ANYWITHDRAW[K comparable, V any](in map[K]V) (K, V)
- func COALESCE[T comparable](in ...T) T
- func CleanComponents(a any)
- func EXEC(ctx context.Context, path string, stdin io.Reader) (code int, stdout, stderr *bytes.Buffer, err error)
- func EXPLODE[T any](num int, f func(int) T) []T
- func ExecuteOnAllFields(ctx context.Context, a any, mname string) error
- func FANIN[T any](src chan T) (generator func() chan T, destructor func())
- func FANOUT[T any](src <-chan T) (generator func() (tap <-chan T, destructor func()))
- func FLATLIST[T any](arrs [][]T) []T
- func GREP[T any](arr []T, f func(T) bool) []T
- func HAVEKEY[K comparable, V any](in map[K]V, key K) bool
- func InjectComponents(a any)
- func KEYS[K comparable, V any](in map[K]V) []K
- func MAP[IN any, OUT any](arr []IN, f func(IN) OUT) []OUT
- func MAPCONCAT[T any](a, b map[string]T) (ret map[string]T)
- func MUST(err error)
- func MUST2[T1 any](a1 T1, err error) T1
- func MUST3[T1 any, T2 any](a1 T1, a2 T2, err error) (T1, T2)
- func MUST4[T1 any, T2 any, T3 any](a1 T1, a2 T2, a3 T3, err error) (T1, T2, T3)
- func MUST5[T1 any, T2 any, T3 any, T4 any](a1 T1, a2 T2, a3 T3, a4 T4, err error) (T1, T2, T3, T4)
- func NBRECV[T any](ch <-chan T) (T, bool)
- func NBSEND[T any](ch chan<- T, val T) bool
- func RECV[T any](ctx context.Context, ch <-chan T) (T, bool)
- func REDUCE[IN any, ACC any](init ACC, in []IN, f func(int, IN, *ACC)) *ACC
- func REF[T any](in T) *T
- func SEND[T any](ctx context.Context, ch chan<- T, val T)
- func SWAPPER[T any](slice []T) func(i, j int)
- func TERNARY[T any](e bool, a, b T) T
- func TYPEOK[T any](_ T, ok bool) bool
- func ToJson(in any) string
- func VALUES[K comparable, V any](in map[K]V) []V
- func WAIT[T any](ctx context.Context, ch <-chan T, cb func(T))
- type CHANGEWATCHERFUNC
- type COMMENTABLETYPE
- type REQUESTTYPE
- func (r REQUESTTYPE[REQ, RES]) RESPOND(ctx context.Context, res RES) REQUESTTYPE[REQ, RES]
- func (r REQUESTTYPE[REQ, RES]) SEND(ctx context.Context, c chan REQUESTTYPE[REQ, RES]) REQUESTTYPE[REQ, RES]
- func (r REQUESTTYPE[REQ, RES]) THEN(ctx context.Context, f func(context.Context, RES)) REQUESTTYPE[REQ, RES]
- type SUBSCRIPTION
Constants ¶
const DEBUG = false
Variables ¶
This section is empty.
Functions ¶
func ANYKEY ¶
func ANYKEY[K comparable, V any](in map[K]V) K
ANYKEY - Returns any arbitrary key from map.
func ANYWITHDRAW ¶ added in v1.0.4
func ANYWITHDRAW[K comparable, V any](in map[K]V) (K, V)
ANYWITHDRAW - Chooses arbitrary key from map, delete it and return.
func COALESCE ¶ added in v1.1.2
func COALESCE[T comparable](in ...T) T
COALESCE - return first non zero(false) value
func CleanComponents ¶ added in v1.1.6
func CleanComponents(a any)
func ExecuteOnAllFields ¶ added in v1.0.6
ExecuteOnAllFields - On all interface fields run method by name
func FANIN ¶ added in v1.1.0
func FANIN[T any](src chan T) (generator func() chan T, destructor func())
FANIN - returns channel generator that push all incoming into one channel
func FANOUT ¶ added in v1.1.0
func FANOUT[T any](src <-chan T) ( generator func() (tap <-chan T, destructor func()), )
FANOUT - returns function that returns channels attached to source chan
func FLATLIST ¶ added in v1.0.2
func FLATLIST[T any](arrs [][]T) []T
FLATLIST - flaterns list of lists to just list
func GREP ¶
GREP - This is filter, that leaves only that elements that trigerrs callback function to return true
func HAVEKEY ¶
func HAVEKEY[K comparable, V any](in map[K]V, key K) bool
HAVEKEY - Just indicates do we have key in map, or no.
func InjectComponents ¶ added in v1.1.1
func InjectComponents(a any)
InjectComponents - search for corresponding fields in fields and put references there
func KEYS ¶
func KEYS[K comparable, V any](in map[K]V) []K
KEYS - Returns full set of keys from map to use it further
func MAP ¶
MAP - This is part of mapreduce and almost full copy of perl's map. It transforms input array to output array with callback function.
func REDUCE ¶ added in v1.0.1
REDUCE - Takes array and applies callback function to aggregate object and each element of array. Starts from init.
func VALUES ¶ added in v1.0.4
func VALUES[K comparable, V any](in map[K]V) []V
VALUES - Returns full set of values from map to use it further
Types ¶
type CHANGEWATCHERFUNC ¶ added in v1.1.1
type CHANGEWATCHERFUNC[T comparable] func(n T) bool
func CHANGEWATCHER ¶ added in v1.1.1
func CHANGEWATCHER[T comparable](name string, o T) CHANGEWATCHERFUNC[T]
CHANGEWATCHER - was variabe changed from previous call
type COMMENTABLETYPE ¶ added in v1.1.3
type COMMENTABLETYPE[T any] struct{ T T }
func COMMENTABLE ¶ added in v1.1.3
func COMMENTABLE[T any](in T) COMMENTABLETYPE[T]
func (*COMMENTABLETYPE[T]) MarshalYAML ¶ added in v1.1.3
func (C *COMMENTABLETYPE[T]) MarshalYAML() (interface{}, error)
type REQUESTTYPE ¶ added in v1.1.6
func REQUEST ¶ added in v1.1.6
func REQUEST[REQ any, RES any](req REQ) REQUESTTYPE[REQ, RES]
func (REQUESTTYPE[REQ, RES]) RESPOND ¶ added in v1.1.6
func (r REQUESTTYPE[REQ, RES]) RESPOND(ctx context.Context, res RES) REQUESTTYPE[REQ, RES]
func (REQUESTTYPE[REQ, RES]) SEND ¶ added in v1.1.6
func (r REQUESTTYPE[REQ, RES]) SEND(ctx context.Context, c chan REQUESTTYPE[REQ, RES]) REQUESTTYPE[REQ, RES]
func (REQUESTTYPE[REQ, RES]) THEN ¶ added in v1.1.6
func (r REQUESTTYPE[REQ, RES]) THEN(ctx context.Context, f func(context.Context, RES)) REQUESTTYPE[REQ, RES]
type SUBSCRIPTION ¶ added in v1.1.4
type SUBSCRIPTION[A comparable, T any] struct { sync.Mutex M map[A][]chan T }
func NewSUBSCRIPTION ¶ added in v1.1.4
func NewSUBSCRIPTION[A comparable, T any]() *SUBSCRIPTION[A, T]
func (*SUBSCRIPTION[A, T]) Close ¶ added in v1.1.4
func (s *SUBSCRIPTION[A, T]) Close(id A)
func (*SUBSCRIPTION[A, T]) Has ¶ added in v1.1.7
func (s *SUBSCRIPTION[A, T]) Has(id A) bool
func (*SUBSCRIPTION[A, T]) Notify ¶ added in v1.1.4
func (s *SUBSCRIPTION[A, T]) Notify(id A, data T)
func (*SUBSCRIPTION[A, T]) Subscribe ¶ added in v1.1.4
func (s *SUBSCRIPTION[A, T]) Subscribe(id A) chan T
func (*SUBSCRIPTION[A, T]) UnSubscribe ¶ added in v1.1.6
func (s *SUBSCRIPTION[A, T]) UnSubscribe(id A, c chan T)