tags

package module
v0.0.0-...-bef1fb0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2016 License: Apache-2.0 Imports: 7 Imported by: 1

README

tags

Build Status GoDoc

Tags packages have simple data structures and functions to store and manipulate a list of tags.

Documentation

Overview

Tags packages have simple data structures and functions to store and manipulate a list of tags.

Index

Constants

View Source
const ErrInvalidTagChar = "invalid tag character"
View Source
const ErrInvalidTagsLength = "list of tags is big"
View Source
const ErrNoTags = "no tags"
View Source
const ErrTagDoesntExit = "tag doesn't exist"
View Source
const ErrTagExist = "tag exist"
View Source
const ErrTagNotFound = "tag not found"

Variables

View Source
var TagStringMax = 3000
View Source
var TagStringMin = 1

Functions

func CheckTag

func CheckTag(tag string) error

Check if a tag is formed with the corrects characters

func CheckTags

func CheckTags(tags string) error

Check if a set of tags are correctly formated.

Types

type Tags

type Tags []string

func NewTags

func NewTags(tags string) (*Tags, error)

NewTags creates a new tag list from a comma separeted list of tags.

func (*Tags) Add

func (t *Tags) Add(tag string) error

Add one tag to the list

func (*Tags) Compare

func (t *Tags) Compare(tr *Tags) int

Compare compares two sets of tags and return the number of matchs.

func (*Tags) Copy

func (t *Tags) Copy() *Tags

Copy makes a copy

func (*Tags) DecodeMsgpack

func (t *Tags) DecodeMsgpack(dec *msgpack.Decoder) error

func (*Tags) EncodeMsgpack

func (t *Tags) EncodeMsgpack(enc *msgpack.Encoder) error

func (*Tags) Exist

func (t *Tags) Exist(target string) bool

Exist verifies if a tag exist.

func (*Tags) Get

func (t *Tags) Get() string

Get all tags

func (*Tags) Len

func (t *Tags) Len() int

Return the number of tags.

func (*Tags) Less

func (t *Tags) Less(i, j int) bool

Check if one that is less than other.

func (*Tags) Merge

func (t *Tags) Merge(tags *Tags) error

Merge merges two tags sets.

func (*Tags) MergeFromStringSlice

func (t *Tags) MergeFromStringSlice(slice []string) error

MergeFromStringSlice merges a slice, unordered and unchecked, into a tags. Check all slice itens in the process.

func (*Tags) Remove

func (t *Tags) Remove(tag string) error

Remove a tag from the list.

func (*Tags) Replace

func (t *Tags) Replace(s string) error

Replace all tags with new tags in the string, that is formated in a comma separated list.

func (*Tags) Same

func (t *Tags) Same(tr *Tags) bool

Same verifies if the tags sets are the same.

func (*Tags) String

func (t *Tags) String() string

String givers tags string formated

func (*Tags) Swap

func (t *Tags) Swap(i, j int)

Change the place of two tags.

Jump to

Keyboard shortcuts

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