set

package
v0.0.0-...-4cbfb34 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

SPDX-Copyright: Copyright (c) Capital One Services, LLC SPDX-License-Identifier: Apache-2.0 Copyright 2017 Capital One Services, LLC

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

SPDX-Copyright: Copyright (c) Capital One Services, LLC SPDX-License-Identifier: Apache-2.0 Copyright 2017 Capital One Services, LLC

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LowerSet

type LowerSet map[lowercase.String]bool

LowerSet is a collection of unique lowercase strings

func EmptyLower

func EmptyLower() LowerSet

Empty creates an empty lowerset

func NewLower

func NewLower(keys ...lowercase.String) LowerSet

NewLower creates a new lowerset with the provided values

func NewLowerFromString

func NewLowerFromString(keys ...string) LowerSet

NewLowerFromString creates a new lowerset with the provided values

func (LowerSet) Add

func (s LowerSet) Add(key lowercase.String)

Add inserts an element into the lowerset

func (LowerSet) AddAll

func (s LowerSet) AddAll(input LowerSet)

AddAll inserts all elements from a lowerset into the lowerset

func (LowerSet) AddAllSet

func (s LowerSet) AddAllSet(input Set)

AddAll inserts all elements from a set into the lowerset

func (LowerSet) AddString

func (s LowerSet) AddString(key string)

func (LowerSet) Contains

func (s LowerSet) Contains(key lowercase.String) bool

Contains tests whether an element is a member of the lowerset

func (LowerSet) ContainsString

func (s LowerSet) ContainsString(key string) bool

ContainsString tests whether an element is a member of the lowerset

func (LowerSet) Difference

func (s LowerSet) Difference(other LowerSet) LowerSet

Difference returns all elements that are in this lowerset but not in the passed-in lowerset

func (LowerSet) Intersection

func (s LowerSet) Intersection(other LowerSet) LowerSet

Intersection returns all elements in common between this lowerset and the lowerset passed in

func (LowerSet) Keys

func (s LowerSet) Keys() lowercase.Slice

func (LowerSet) KeysSorted

func (s LowerSet) KeysSorted(f func(s1, s2 lowercase.String) bool) lowercase.Slice

func (LowerSet) MarshalJSON

func (s LowerSet) MarshalJSON() ([]byte, error)

func (LowerSet) Print

func (s LowerSet) Print(sep string) string

func (LowerSet) Remove

func (s LowerSet) Remove(key lowercase.String)

Remove deletes an element from the lowerset

func (LowerSet) RemoveString

func (s LowerSet) RemoveString(key string)

func (LowerSet) ToSet

func (s LowerSet) ToSet() Set

func (*LowerSet) UnmarshalJSON

func (s *LowerSet) UnmarshalJSON(data []byte) error

type Set

type Set map[string]bool

Set is a collection of unique strings

func Empty

func Empty() Set

Empty creates an empty set

func New

func New(keys ...string) Set

New creates a new set with the provided values

func (Set) Add

func (s Set) Add(key string)

Add inserts an element into the set

func (Set) AddAll

func (s Set) AddAll(input Set)

AddAll inserts all element into the set

func (Set) Contains

func (s Set) Contains(key string) bool

Contains tests whether an element is a member of the set

func (Set) Difference

func (s Set) Difference(other Set) Set

func (Set) Intersection

func (s Set) Intersection(other Set) Set

func (Set) Keys

func (s Set) Keys() []string

func (Set) KeysSorted

func (s Set) KeysSorted(f func(s1, s2 string) bool) []string

func (Set) MarshalJSON

func (s Set) MarshalJSON() ([]byte, error)

func (Set) Print

func (s Set) Print(sep string) string

func (Set) Remove

func (s Set) Remove(key string)

Remove deletes an element from the set

func (*Set) UnmarshalJSON

func (s *Set) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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