Documentation

Overview

    Package set provides a simple set implementation.

    It's under internal because with generics on the horizon there will sure be breaking changes to this package, so we don't want to make it part of the public API.

    Index

    Constants

    This section is empty.

    Variables

    This section is empty.

    Functions

    This section is empty.

    Types

    type Interface

    type Interface map[interface{}]Value

      Interface defines a set of interface{}.

      The actual value put in must be comparable.

      func Literal

      func Literal(literals ...interface{}) Interface

        Literal creates an Interface set from literals.

        func (Interface) Add

        func (s Interface) Add(v interface{})

          Add adds an value to the set.

          func (Interface) Has

          func (s Interface) Has(v interface{}) bool

            Has returns true if v is in the string set.

            type String

            type String map[string]Value

              String defines a set of string.

              func StringLiteral

              func StringLiteral(literals ...string) String

                StringLiteral creates a String set from string literals.

                func (String) Add

                func (s String) Add(v string)

                  Add adds an value to the set.

                  func (String) Has

                  func (s String) Has(v string) bool

                    Has returns true if v is in the string set.

                    type Value

                    type Value struct{}

                      Value is the empty value type used in map as set.

                      var DummyValue Value

                        DummyValue is the empty value used in map as set.