types

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2021 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsEnvVariables

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

AsEnvVariables sets struct values from environment variables

func IsNil

func IsNil(c interface{}) bool

IsNil returns true if given object is nil

func SecureCompare

func SecureCompare(given, actual []byte) bool

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

func SecureCompareString

func SecureCompareString(given, actual string) bool

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

Types

type Metadata

type Metadata map[string][]string

Metadata represents object metadata

func (Metadata) Append

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

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

Get obtains the values for a given key.

func (Metadata) Has

func (md Metadata) Has(k string) bool

Has returns true if metadata has given key

func (Metadata) Len

func (md Metadata) Len() int

Len returns the number of items in md.

func (Metadata) Set

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

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

type StringArray

type StringArray []string

StringArray describes string array type

func (*StringArray) AddIfNotContains

func (s *StringArray) AddIfNotContains(item string)

AddIfNotContains add item if not already in collection

func (StringArray) Contains

func (s StringArray) Contains(item string) bool

Contains checks if item is in collection

func (*StringArray) HasOneOf

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

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

func (*StringArray) Remove

func (s *StringArray) Remove(item string)

Remove item from collection

Jump to

Keyboard shortcuts

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