pkg: Index | Files

package types

import ""


Package Files

compare.go env.go meta.go null.go string_array.go

func AsEnvVariables Uses

func AsEnvVariables(o interface{}, prefix string, skipCommented bool) (map[string]string, error)

AsEnvVariables sets struct values from environment variables

func IsNil Uses

func IsNil(c interface{}) bool

IsNil returns true if given object is nil

func SecureCompare Uses

func SecureCompare(given, actual []byte) bool

SecureCompare use constant time function to compare the two given array.

func SecureCompareString Uses

func SecureCompareString(given, actual string) bool

SecureCompareString use constant time function to compare the two given string.

type Metadata Uses

type Metadata map[string][]string

Metadata represents object metadata

func (Metadata) Append Uses

func (md Metadata) Append(k string, vals ...string)

Append adds the values to key k, not overwriting what was already stored at that key.

func (Metadata) Get Uses

func (md Metadata) Get(k string) []string

Get obtains the values for a given key.

func (Metadata) Has Uses

func (md Metadata) Has(k string) bool

Has returns true if metadata has given key

func (Metadata) Len Uses

func (md Metadata) Len() int

Len returns the number of items in md.

func (Metadata) Set Uses

func (md Metadata) Set(k string, vals ...string)

Set sets the value of a given key with a slice of values.

type StringArray Uses

type StringArray []string

StringArray describes string array type

func (*StringArray) AddIfNotContains Uses

func (s *StringArray) AddIfNotContains(item string)

AddIfNotContains add item if not already in collection

func (StringArray) Contains Uses

func (s StringArray) Contains(item string) bool

Contains checks if item is in collection

func (*StringArray) HasOneOf Uses

func (s *StringArray) HasOneOf(items ...string) bool

HasOneOf returns true when one of provided items is found in array.

func (*StringArray) Remove Uses

func (s *StringArray) Remove(item string)

Remove item from collection

Package types imports 6 packages (graph). Updated 2020-06-14. Refresh now. Tools for package owners.