types

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2019 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNil

func IsNil(c interface{}) bool

IsNil returns true if given object is nil

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