Package n provides a set of types with convenience methods for Go akin to rapid development languages. n was created to reduce the friction I had adopting Go as my primary language of choice. It does this by reducing the coding verbosity Go normally requires. n types wrap various Go types to provide generic convenience methods reminiscent of C#'s Queryable interface, removing the need to implement the 'Contains' function, on basic list primitives for the millionth time. The intent is at a minimum to have support for YAML primitive scalars (Null, String, Integer, Boolean, Float, Timestamp), lists of the scalar types and maps of the scalar types with reflection based fallbacks for un-optimized types. I'll be using the terms 'n types' or 'queryable' interchangeably in the documentation and examples. • In order to deal with Golang's decision to not support function overloading or special characters in their function names n makes use of a variety of prefix/suffix capital letters to indicate different function variations. The function/method that contains no suffix is referred to as the base function/method. • Function names suffixed with 'A' indicates the function is a variation to the function without the 'A' but either accepts a string as input or returns a string. • Function names suffixed with 'E' indicates the function is a variation to the function without the 'E' but returns an Error while the base function does not. • Function names suffixed with 'M' indicates the function is a variation to the function without the 'M' but modifies the n type directly rather than a copy. • Function names suffixed with 'R' indicates the function is a variation to the function without the 'R' but reverses the order of operations. • Function names suffixed with 'S' indicates the function is a variation to the function without the 'S' but either accepts a ISlice as input or returns a ISlice. • Function names suffixed with 'V' indicates the function is a variation to the function • Function names suffixed with 'V' indicates the function is a variation to the function without the 'V' but accepts variadic input. • Function names suffixed with 'W' indicates the function is a variation to the function without the 'W' but accepts a lambda expression as input. • Documentation should be thorough and relied upon for guidance as, for a love of brevity, some functions are named with a single capital letter only. 'G' is being used to export the underlying Go type. 'O' is being used to indicate the interface{} type or to export the underlying Go type as an interface{}. 'S' is used to refer to slice types, 'M' refers to map types, 'A' refers to string types, 'I' ints types, 'R' rune types and combinations may be used to indicate complex types. The documentation will always call out what exactly they mean, but the function name may be cryptic until understood. • Char • FloatSlice • IntSlice • InterSlice • Object • RefSlice • Str • StringSlice • StringMap
Package codec provides a High Performance, Feature-Rich Idiomatic Go 1.4+ codec/encoding library for binc, msgpack, cbor, json. Supported Serialization formats are: To install: This package will carefully use 'unsafe' for performance reasons in specific places. You can build without unsafe use by passing the safe or appengine tag i.e. 'go install -tags=safe ...'. Note that unsafe is only supported for the last 3 go sdk versions e.g. current go release is go 1.9, so we support unsafe use only from go 1.7+ . This is because supporting unsafe requires knowledge of implementation details. For detailed usage information, read the primer at http://ugorji.net/blog/go-codec-primer . The idiomatic Go support is as seen in other encoding packages in the standard library (ie json, xml, gob, etc). Rich Feature Set includes: Users can register a function to handle the encoding or decoding of their custom types. There are no restrictions on what the custom type can be. Some examples: As an illustration, MyStructWithUnexportedFields would normally be encoded as an empty map because it has no exported fields, while UUID would be encoded as a string. However, with extension support, you can encode any of these however you like. This package maintains symmetry in the encoding and decoding halfs. We determine how to encode or decode by walking this decision tree This symmetry is important to reduce chances of issues happening because the encoding and decoding sides are out of sync e.g. decoded via very specific encoding.TextUnmarshaler but encoded via kind-specific generalized mode. Consequently, if a type only defines one-half of the symmetry (e.g. it implements UnmarshalJSON() but not MarshalJSON() ), then that type doesn't satisfy the check and we will continue walking down the decision tree. RPC Client and Server Codecs are implemented, so the codecs can be used with the standard net/rpc package. The Handle is SAFE for concurrent READ, but NOT SAFE for concurrent modification. The Encoder and Decoder are NOT safe for concurrent use. Consequently, the usage model is basically: Sample usage model: To run tests, use the following: To run the full suite of tests, use the following: You can run the tag 'safe' to run tests or build in safe mode. e.g. Please see http://github.com/ugorji/go-codec-bench . Struct fields matching the following are ignored during encoding and decoding Every other field in a struct will be encoded/decoded. Embedded fields are encoded as if they exist in the top-level struct, with some caveats. See Encode documentation.
Package iterator contains an implementation of the map, filter, reduce pattern for Go.
Package codec provides a High Performance, Feature-Rich Idiomatic Go 1.4+ codec/encoding library for binc, msgpack, cbor, json. Supported Serialization formats are: To install: This package will carefully use 'unsafe' for performance reasons in specific places. You can build without unsafe use by passing the safe or appengine tag i.e. 'go install -tags=safe ...'. Note that unsafe is only supported for the last 3 go sdk versions e.g. current go release is go 1.9, so we support unsafe use only from go 1.7+ . This is because supporting unsafe requires knowledge of implementation details. For detailed usage information, read the primer at http://ugorji.net/blog/go-codec-primer . The idiomatic Go support is as seen in other encoding packages in the standard library (ie json, xml, gob, etc). Rich Feature Set includes: Users can register a function to handle the encoding or decoding of their custom types. There are no restrictions on what the custom type can be. Some examples: As an illustration, MyStructWithUnexportedFields would normally be encoded as an empty map because it has no exported fields, while UUID would be encoded as a string. However, with extension support, you can encode any of these however you like. This package maintains symmetry in the encoding and decoding halfs. We determine how to encode or decode by walking this decision tree This symmetry is important to reduce chances of issues happening because the encoding and decoding sides are out of sync e.g. decoded via very specific encoding.TextUnmarshaler but encoded via kind-specific generalized mode. Consequently, if a type only defines one-half of the symmetry (e.g. it implements UnmarshalJSON() but not MarshalJSON() ), then that type doesn't satisfy the check and we will continue walking down the decision tree. RPC Client and Server Codecs are implemented, so the codecs can be used with the standard net/rpc package. The Handle is SAFE for concurrent READ, but NOT SAFE for concurrent modification. The Encoder and Decoder are NOT safe for concurrent use. Consequently, the usage model is basically: Sample usage model: To run tests, use the following: To run the full suite of tests, use the following: You can run the tag 'safe' to run tests or build in safe mode. e.g. Please see http://github.com/ugorji/go-codec-bench . Struct fields matching the following are ignored during encoding and decoding Every other field in a struct will be encoded/decoded. Embedded fields are encoded as if they exist in the top-level struct, with some caveats. See Encode documentation.
mapreduce is a package that provides a generics-typed and concurrent implementation of the map-reduce paradigm
Package factschema defines the versioned collector-reducer payload contracts described in Contract System v1 (docs/internal/design/contract-system-v1.md, §3.1-3.2): the canonical Envelope, one typed payload struct per fact kind under "<family>/v<major>" (including aws/v1, iam/v1, incident/v1, and vulnerabilitysuppression/v1), the generated JSON Schemas checked in under schema/, and a kind-keyed decode seam so a reducer handler always codes against a validated, latest-version struct instead of reading map[string]any payload keys by hand.
package mfr offers standard functional operations: Map, Filter, Reduce
Package codec provides a High Performance, Feature-Rich Idiomatic Go 1.4+ codec/encoding library for binc, msgpack, cbor, json. Supported Serialization formats are: To install: This package will carefully use 'unsafe' for performance reasons in specific places. You can build without unsafe use by passing the safe or appengine tag i.e. 'go install -tags=safe ...'. Note that unsafe is only supported for the last 3 go sdk versions e.g. current go release is go 1.9, so we support unsafe use only from go 1.7+ . This is because supporting unsafe requires knowledge of implementation details. For detailed usage information, read the primer at http://ugorji.net/blog/go-codec-primer . The idiomatic Go support is as seen in other encoding packages in the standard library (ie json, xml, gob, etc). Rich Feature Set includes: Users can register a function to handle the encoding or decoding of their custom types. There are no restrictions on what the custom type can be. Some examples: As an illustration, MyStructWithUnexportedFields would normally be encoded as an empty map because it has no exported fields, while UUID would be encoded as a string. However, with extension support, you can encode any of these however you like. This package maintains symmetry in the encoding and decoding halfs. We determine how to encode or decode by walking this decision tree This symmetry is important to reduce chances of issues happening because the encoding and decoding sides are out of sync e.g. decoded via very specific encoding.TextUnmarshaler but encoded via kind-specific generalized mode. Consequently, if a type only defines one-half of the symmetry (e.g. it implements UnmarshalJSON() but not MarshalJSON() ), then that type doesn't satisfy the check and we will continue walking down the decision tree. RPC Client and Server Codecs are implemented, so the codecs can be used with the standard net/rpc package. The Handle is SAFE for concurrent READ, but NOT SAFE for concurrent modification. The Encoder and Decoder are NOT safe for concurrent use. Consequently, the usage model is basically: Sample usage model: To run tests, use the following: To run the full suite of tests, use the following: You can run the tag 'safe' to run tests or build in safe mode. e.g. Please see http://github.com/ugorji/go-codec-bench . Struct fields matching the following are ignored during encoding and decoding Every other field in a struct will be encoded/decoded. Embedded fields are encoded as if they exist in the top-level struct, with some caveats. See Encode documentation.