set

package
Version: v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package set implements a kiwi.Value which can store a set of strings.

Index

Constants

View Source
const (
	// Insert inserts the element(s) in the set.
	//
	// Returns an array of added elements.
	Insert kiwi.Action = "INSERT"

	// Remove removes the element(s) from the set.
	//
	// Returns an array of removed elements.
	Remove kiwi.Action = "REMOVE"

	// Has checks if set has the element.
	//
	// Returns boolean value.
	Has kiwi.Action = "HAS"

	// Len gets the length of the set.
	//
	// Returns an integer.
	Len kiwi.Action = "LEN"

	// Get gets all the elements of set.
	//
	// Returns an array of elements.
	Get kiwi.Action = "GET"
)
View Source
const Type kiwi.ValueType = "set"

Type of set value.

Variables

View Source
var (
	ErrInvalidParamLen  = fmt.Errorf("not enough parameters")
	ErrInvalidParamType = fmt.Errorf("invalid paramater type")
)

Various errors for set value type.

Functions

This section is empty.

Types

type Value

type Value map[string]struct{}

Value can store a set of strings.

It implements the kiwi.Value interface.

func (*Value) DoMap

func (v *Value) DoMap() map[kiwi.Action]kiwi.DoFunc

DoMap returns the map of v's actions with it's do functions.

func (*Value) FromJSON

func (v *Value) FromJSON(rawmessage json.RawMessage) error

FromJSON populates the value with the data from RawMessage

func (*Value) ToJSON

func (v *Value) ToJSON() (json.RawMessage, error)

ToJSON returns the raw byte array of value

func (*Value) Type

func (v *Value) Type() kiwi.ValueType

Type returns v's type, i.e., "set".

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto