strings

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainPartial

func ContainPartial(list []string, partial string) (result []string)

func ConvertStringSliceToMap added in v0.9.2

func ConvertStringSliceToMap(stringSlice []string) (stringInterfaceMap map[string]string)

ConvertStringSliceToMap Convert []string to map[string]string

func Diff

func Diff(old, new []net.IP) (add, sub []net.IP)

func IsInSlice added in v0.9.0

func IsInSlice(key string, slice []string) bool

func IsLetterOrNumber

func IsLetterOrNumber(k string) bool

func Merge

func Merge(ms ...[]string) []string

Merge :merge slice type as overwrite model

func RemoveDuplicate

func RemoveDuplicate(list []string) []string

func Reverse

func Reverse(s []string) []string

Types

type Comparator

type Comparator struct {
	Src []string
	Dst []string
}

func (Comparator) GetDstSubtraction

func (c Comparator) GetDstSubtraction() []string

func (Comparator) GetIntersection

func (c Comparator) GetIntersection() []string

func (Comparator) GetSrcSubtraction

func (c Comparator) GetSrcSubtraction() []string

func (Comparator) GetUnion

func (c Comparator) GetUnion() []string

type Interface

type Interface interface {
	// GetIntersection get intersection element form between slice.
	GetIntersection() []string
	// GetUnion get Union element between two slice.
	GetUnion() []string
	// GetSrcSubtraction get different element in src compare to dst.
	GetSrcSubtraction() []string
	// GetDstSubtraction get different element in dst compare to src.
	GetDstSubtraction() []string
}

func NewComparator

func NewComparator(src, dst []string) Interface

Jump to

Keyboard shortcuts

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