utils

package
v0.0.0-...-8fb3740 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2016 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const NameChars = `[a-zA-Z0-9][a-zA-Z0-9_-]`

Variables

View Source
var (
	EmptyCursorEvents = CursorEvents("")
)
View Source
var NamePattern = regexp.MustCompile(`^/?` + NameChars + `+$`)
View Source
var NameSeparator = `.`
View Source
var SpecialNamePattern = regexp.
	MustCompile(
		"^(?P<channel>" +
			NameChars +
			"+)?" +
			NameSeparator + "?" +
			"(?P<thread>" +
			NameChars +
			"+)?$",
	)

Functions

func Base64

func Base64(v []byte) string

func DecodeBase64

func DecodeBase64(str string) ([]byte, error)

func HashText

func HashText(text string) string

func NewUUID4

func NewUUID4() string

NewUUID4 returns uuid version 4

func ValidName

func ValidName(name string) error

Types

type CursorEvents

type CursorEvents string

func NewCursorEvents

func NewCursorEvents(str string) CursorEvents

func NewCursorEventsFromEvent

func NewCursorEventsFromEvent(e hey.Event) CursorEvents

func NewCursorFromSource

func NewCursorFromSource(eventID uuid.UUID, createdAt time.Time) CursorEvents

func (CursorEvents) LastCreatedAt

func (c CursorEvents) LastCreatedAt() time.Time

func (CursorEvents) LastEventID

func (c CursorEvents) LastEventID() uuid.UUID

func (CursorEvents) String

func (c CursorEvents) String() string

type SpecialName

type SpecialName string

func (SpecialName) Channel

func (s SpecialName) Channel() string

func (SpecialName) Thread

func (s SpecialName) Thread() string

func (SpecialName) Valid

func (s SpecialName) Valid() bool

type UUIDS

type UUIDS []uuid.UUID

func UUIDSFrom

func UUIDSFrom(arr []uuid.UUID) UUIDS

func (*UUIDS) Add

func (c *UUIDS) Add(v interface{}) *UUIDS

func (*UUIDS) FromArray

func (c *UUIDS) FromArray(v interface{}) *UUIDS

func (*UUIDS) IsExist

func (c *UUIDS) IsExist(v uuid.UUID) bool

func (*UUIDS) Scan

func (m *UUIDS) Scan(value interface{}) error

func (UUIDS) Value

func (m UUIDS) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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