suuid

package module
v0.0.0-...-73abb5e Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2018 License: MIT Imports: 6 Imported by: 0

README

UUID package for Go language

A Go library that generates concise, unambiguous, URL-safe UUIDs. Based on and compatible with the Python library shortuuid.

Install

go get github.com/houndgo/suuid

Usage

import (
	"fmt"
	"strings"

	"github.com/houndgo/suuid"
)

func main() {
  uid := suuid.New()
  fmt.Println("\n uuid is: ", uid) //fnB6fRCHrPqStSXYEs7W73 by uuid is 6e8e463e-d39c-460e-9e62-35192ff11f89
}

License

MIT

Documentation

Index

Constants

View Source
const (
	//DefaultAlphabet is the default alphabet used.
	DefaultAlphabet = "23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SUUID

type SUUID struct {
	// contains filtered or unexported fields
}

SUUID is pg Namespaces Mount

func New

func New() *SUUID

New is SUUID method

func NewWithAlphabet

func NewWithAlphabet(alphabet string) *SUUID

NewWithAlphabet is SUUID method

func (*SUUID) Decode

func (s *SUUID) Decode(input string) (uuid.UUID, error)

Decode is

func (*SUUID) Encode

func (s *SUUID) Encode(uuid uuid.UUID) string

Encode is Encodes a UUID into a string (LSB first) according to the alphabet If leftmost (MSB) bits 0, string might be shorter

func (*SUUID) SetAlphabet

func (s *SUUID) SetAlphabet(alphabet string)

SetAlphabet is SUUID method

func (SUUID) String

func (s SUUID) String() string

func (*SUUID) UUID

func (s *SUUID) UUID(name string) string

UUID is SUUID method

type StringSet

type StringSet struct {
	// contains filtered or unexported fields
}

StringSet is string sets val

func NewStringSet

func NewStringSet() *StringSet

NewStringSet is new set

func (*StringSet) Add

func (set *StringSet) Add(i string) bool

Add is

func (*StringSet) Contains

func (set *StringSet) Contains(i string) bool

Contains is

func (*StringSet) Index

func (set *StringSet) Index(c string) int

Index is

func (*StringSet) ItemByIndex

func (set *StringSet) ItemByIndex(idx int) string

ItemByIndex is

func (*StringSet) Len

func (set *StringSet) Len() int

Len is

func (*StringSet) Remove

func (set *StringSet) Remove(i string)

Remove is

func (*StringSet) Sort

func (set *StringSet) Sort()

Sort is

func (*StringSet) String

func (set *StringSet) String() string

String is

Jump to

Keyboard shortcuts

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