sqlTypes

package
v0.0.0-...-e54010c Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Overview

sqlTypes package implements the following: TagSet - maintain a set of unique tags/labels

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TagSet

type TagSet map[string]struct{}

TagSet is a set of unique tag entries

func NewTagSet

func NewTagSet(tags []string) TagSet

NewTagSet creates a fresh set from a list of strings

func (TagSet) Add

func (a TagSet) Add(tag string)

Add make a value present

func (TagSet) AddAll

func (a TagSet) AddAll(tags []string)

AddAll make a list of values present

func (TagSet) All

func (a TagSet) All() []string

All the values sorted in ascending order

func (TagSet) Has

func (a TagSet) Has(tag string) bool

Has check if a value is present

func (*TagSet) Scan

func (a *TagSet) Scan(value interface{}) error

Scan Postgres array into a TagSet, implements sql.Scanner interface parses a PostgreSQL array value like {abcd,"a,b",1234}

func (TagSet) Value

func (a TagSet) Value() (driver.Value, error)

Value returns Postgres Array value, implement driver.Value interface output is a PostgreSQL array of strings, all quoted: {"abcd","a,b","1234","he said: \"ok\""}

Jump to

Keyboard shortcuts

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