SkillAgentSearch skills...

Collections

parody of some of the basic python core features (collections package)

Install / Use

/learn @marcsantiago/Collections
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

collections

import "github.com/marcsantiago/collections"

<a name="pkg-overview">Overview</a>

<a name="pkg-index">Index</a>

<a name="pkg-files">Package files</a>

data.go element_sorters.go generic_map.go interable.go map.go primitive_conversions.go string_encoder.go types.go

<a name="StringEncoder">func</a> StringEncoder

func StringEncoder(encoder *bytes.Buffer, data Data, t Type)

StringEncoder writes data into a bytes buffer, used in the String method

<a name="CounterMap">type</a> CounterMap

type CounterMap interface {
    Map
    MostCommon(n int) []Element
    Subtract(value Data)
    Update(value Data)
}

CounterMap mimics the Python Counter definitions this also implements the collections.Map interface to be able to convert into a ChainMap

<a name="Data">type</a> Data

type Data interface {
    Int() int
    Int32() int32
    Int64() int64
    Float32() float32
    Float64() float64
    String() string
}

Data interface for casting and getting data values used to avoid reflection

<a name="Element">type</a> Element

type Element struct {
    Key   Data
    Value Data
}

Element represents (key, value) with backed by the Data interface

<a name="ElementsByKeyIntAsc">type</a> ElementsByKeyIntAsc

type ElementsByKeyIntAsc []Element

ElementsByKeyIntAsc used to used low to high where key is of type string

<a name="ElementsByKeyIntAsc.Len">func</a> (ElementsByKeyIntAsc) Len

func (e ElementsByKeyIntAsc) Len() int

<a name="ElementsByKeyIntAsc.Less">func</a> (ElementsByKeyIntAsc) Less

func (e ElementsByKeyIntAsc) Less(i, j int) bool

<a name="ElementsByKeyIntAsc.Swap">func</a> (ElementsByKeyIntAsc) Swap

func (e ElementsByKeyIntAsc) Swap(i, j int)

<a name="ElementsByKeyIntDesc">type</a> ElementsByKeyIntDesc

type ElementsByKeyIntDesc []Element

ElementsByKeyIntDesc used to used high to low where key is of type string

<a name="ElementsByKeyIntDesc.Len">func</a> (ElementsByKeyIntDesc) Len

func (e ElementsByKeyIntDesc) Len() int

<a name="ElementsByKeyIntDesc.Less">func</a>

View on GitHub
GitHub Stars18
CategoryDevelopment
Updated1y ago
Forks1

Languages

Go

Security Score

75/100

Audited on Nov 8, 2024

No findings