set

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: MIT Imports: 1 Imported by: 0

README

Package set

set.

Usage

package main

import (
	"log"

	"github.com/QisFj/godry/set"
)

func main() {
	log.Println("Int Set:")
	intSet()
	log.Println("String Set:")
	stringSet()
}

func intSet() {
	s := set.Int{}
	s.Add(1, 1, 1, 2, 2, 2)
	log.Printf("set list: %v\n", s.List())
}

func stringSet() {
	s := set.String{}
	s.Add("1", "1", "1", "2", "2", "2")
	log.Printf("set list: %v\n", s.List())
}

Documentation

Overview

Code generated by go generate; DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Int

type Int map[int]struct{}

func IntDiff

func IntDiff(set1, set2 Int) (both, only1, only2 Int)

func IntMerge

func IntMerge(set1, set2 Int) Int

func (*Int) Add

func (set *Int) Add(es ...int)

func (Int) Contains

func (set Int) Contains(e int) bool

func (Int) ContainsAll

func (set Int) ContainsAll(es ...int) bool

func (Int) ContainsAny

func (set Int) ContainsAny(es ...int) bool

func (Int) List

func (set Int) List() []int

type String

type String map[string]struct{}

func StringDiff

func StringDiff(set1, set2 String) (both, only1, only2 String)

func StringMerge

func StringMerge(set1, set2 String) String

func (*String) Add

func (set *String) Add(es ...string)

func (String) Contains

func (set String) Contains(e string) bool

func (String) ContainsAll

func (set String) ContainsAll(es ...string) bool

func (String) ContainsAny

func (set String) ContainsAny(es ...string) bool

func (String) List

func (set String) List() []string

type T

type T struct {
	// contains filtered or unexported fields
}

func NewT

func NewT(t reflect.Type) T

func TDiff

func TDiff(set1, set2 T) (both, only1, only2 T)

func TMerge

func TMerge(set1, set2 T) T

func (*T) Add

func (set *T) Add(es ...interface{})

func (T) Contains

func (set T) Contains(e interface{}) bool

func (T) ContainsAll

func (set T) ContainsAll(es ...interface{}) bool

func (T) ContainsAny

func (set T) ContainsAny(es ...interface{}) bool

func (T) List

func (set T) List() interface{}

func (*T) New

func (set *T) New(t reflect.Type)

type Uint

type Uint map[uint]struct{}

func UintDiff

func UintDiff(set1, set2 Uint) (both, only1, only2 Uint)

func UintMerge

func UintMerge(set1, set2 Uint) Uint

func (*Uint) Add

func (set *Uint) Add(es ...uint)

func (Uint) Contains

func (set Uint) Contains(e uint) bool

func (Uint) ContainsAll

func (set Uint) ContainsAll(es ...uint) bool

func (Uint) ContainsAny

func (set Uint) ContainsAny(es ...uint) bool

func (Uint) List

func (set Uint) List() []uint

Jump to

Keyboard shortcuts

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