util

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: May 21, 2019 License: Apache-2.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustReadDocs

func MustReadDocs(path string, n int) []doc.Document

MustReadDocs calls ReadDocs and panics if there is an error.

func NewUUID

func NewUUID() ([]byte, error)

NewUUID returns a new UUID.

func NewUUIDForbidden

func NewUUIDForbidden() ([]byte, error)

NewUUIDForbidden is NewUUIDFn which always returns an error in the case that UUIDs are forbidden.

func ReadDocs

func ReadDocs(path string, n int) ([]doc.Document, error)

ReadDocs reads up to n documents from a JSON formatted file at the provided path. It is useful for getting a set of documents to run tests with.

Types

type NewUUIDFn

type NewUUIDFn func() ([]byte, error)

NewUUIDFn is a function for creating new UUIDs.

Jump to

Keyboard shortcuts

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