common

package
v0.0.2-0...-4ce78c8 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: Apache-2.0, Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StringSliceTransform

func StringSliceTransform(values []string, fct func(string) string) []string

StringSliceTransform returns a new slice `s` where s[i] = fct(values[i])

func StructToMap

func StructToMap(obj interface{}) map[string]interface{}

StructToMap converts a struct to a map[string]interface{} based on `json` annotations defaulting to field names

Types

type StringSet

type StringSet map[string]struct{}

StringSet represents a list of uniq strings

func NewStringSet

func NewStringSet(initItems ...string) StringSet

NewStringSet returns as new StringSet initialized with initItems

func (StringSet) Add

func (s StringSet) Add(item string)

Add adds a item to the set

func (StringSet) GetAll

func (s StringSet) GetAll() []string

GetAll returns all the strings from the set

Jump to

Keyboard shortcuts

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