generators

package
v0.0.0-...-60ffb4d Latest Latest
Warning

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

Go to latest
Published: May 4, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetRandom

func SetRandom(r *rand.Rand)

SetRandom allows the use of an externally created random number generator. Helpful in situations when the same set of random values should be generated each time.

Types

type Cup

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

func NewCup

func NewCup(sided, amt int) *Cup

NewCup creates a cupful of dice with the number of sides equal to sided, and the number of dice equal to amt.

func (Cup) Throw

func (c Cup) Throw() ThrowResult

type Die

type Die struct {
	Sided int
}

func (Die) Roll

func (d Die) Roll() int

Roll returns the simulated result of rolling the die

type MobileLog

type MobileLog struct {
	EventID            string    `json:"event_id" faker:"uuid_hyphenated"`
	RecordedTimestamp  time.Time `json:"recorded_timestamp"`
	CollectedTimestamp time.Time `json:"collected_timestamp"`
	Application        string    `json:"application" faker:"oneof: alpha, bravo, charlie, delta, echo, foxtrot"`
	Version            string    `json:"application_version" faker:"oneof: v1.0, v1.1, v1.1-ALPHA, v1.1.1"`
	SystemVersion      string    `json:"operating_system_version" faker:"oneof: tau, phi, rho, zeta"`
	DeviceToken        string    `json:"device_token" faker:"jwt"`
	Manufacturer       string    `json:"manufacturer" faker:"oneof: sony, google, nokia, dell"`
	Category           string    `json:"category" faker:"oneof: bishop, knight, rook, pawn, quuen, king"`
	Level              int       `json:"level" faker:"oneof: 1, 2, 3, 4, 5"`
	Message            string    `json:"message" faker:"sentence"`
	MessageData        string    `json:"message_data" faker:"paragraph"`
}

func MockMobileLog

func MockMobileLog() (MobileLog, error)

func (MobileLog) Serialize

func (ml MobileLog) Serialize() ([]byte, error)

type ThrowResult

type ThrowResult struct {
	Total int   `json:"total"`
	Rolls []int `json:"rolls"`
}

func (ThrowResult) Serialize

func (tr ThrowResult) Serialize() ([]byte, error)

Jump to

Keyboard shortcuts

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