uuid4

package module
v0.0.0-...-68b799e Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2018 License: MIT Imports: 4 Imported by: 17

README

UUID4

Build Status Coverage Status Go Report Card GoDoc

An RFC 4122 compliant UUID library

License

MIT

Installation

$ go get github.com/frankenbeanies/uuid4

Usage

import "github.com/frankenbeanies/uuid4"

Methods

New()

Generates a new UUID4

uuid := uuid4.New()
String()

Provides an RFC 4122 compliant string representation of the UUID4

uuidStr := uuid4.New().String()
fmt.Println(uuidStr)
Bytes()

Provides the byte representation of UUID4

uuidBytes := uuid4.New().Bytes()
fmt.Println(uuid)
ParseString()

Parses string into a UUID4

uuid := uuid4.ParseString("cc2161ae-33c1-4cb1-aa53-e81000f20a30")

Documentation

Overview

Package uuid4 provides functions for generating and parsing uuids compliant with RFC 4122

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UUID4

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

UUID4 is a container for an RFC 4122 compliant uuid

func New

func New() UUID4

New generates a new RFC 4122 compliant uuid

func ParseString

func ParseString(str string) (uuid UUID4, err error)

ParseString parses a RFC 4122 compliant string representation of a uuid into a UUID4

func (UUID4) Bytes

func (uuid UUID4) Bytes() []byte

Bytes provides the bytes of the uuid

func (UUID4) String

func (uuid UUID4) String() string

String provides the uuid in a format compliant with RFC 4122

Jump to

Keyboard shortcuts

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