Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { // ID is a unique event identifier ID string `json:"id"` // Station is a medium cardinality (1000s) string that has a 1 to many association with Events Station string `json:"station"` // UserID is a high cardinality (100s of millions) identifier that has a 1 to many association with events. UserID int `json:"user_id"` // Time the event occured. TODO how is it encoded? Timestamp string `json:"timestamp"` // A set of medium cardinality items to associate with this event. Favorites []string `json:"favorites"` // Set of complex objects. Items []Item `json:"items"` // Ordered list of objects. Ranking []Item `json:"ranking"` IfaceThing Interface `json:"ifacething"` // An integer with a set range of possible values to associate with this event. Velocity int `json:"velocity"` // A boolean to associate with this event. Active bool `json:"active"` // Another boolean at the top level. Alive bool `json:"alive"` // One more boolean with mixed case. DeceasedBoolean bool `json:"deceasedBoolean"` // The location of this event. Geo Geo `json:"geo"` }
Event is an example event that includes a variety of types.
type EventGenerator ¶
type EventGenerator struct {
// contains filtered or unexported fields
}
EventGenerator generates random events.
func NewEventGenerator ¶
func NewEventGenerator(seed int64) *EventGenerator
NewEventGenerator gets a new EventGenerator.
func (*EventGenerator) Event ¶
func (g *EventGenerator) Event() *Event
Event generates a random event.
type Geo ¶
type Geo struct { // Low cardinality association. TimeZone string `json:"timezone"` // Fine grained location. Longitude float64 `json:"longitude"` Latitude float64 `json:"latitude"` }
Geo represents a location.
type Interface ¶
type Interface interface {
// contains filtered or unexported methods
}
Interface exists to make sure that parsing code can handle interface values.
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source is a pdk.Source which generates fake Event data.
type User ¶
type User struct { ID uint64 Age int FirstName string LastName string Allergies []string Title string }
User is a theoretical user type.
type UserGenerator ¶
type UserGenerator struct {
// contains filtered or unexported fields
}
UserGenerator generates fake Users.
func NewUserGenerator ¶
func NewUserGenerator(seed int64) *UserGenerator
NewUserGenerator initializes a new UserGenerator.
func (*UserGenerator) Record ¶
func (u *UserGenerator) Record() *User
Record returns a random User record with realistic-ish values.
type UserSource ¶
type UserSource struct {
// contains filtered or unexported fields
}
UserSource is a pdk.Source which generates fake user data.
func NewUserSource ¶
func NewUserSource(seed int64, max uint64) *UserSource
NewUserSource creates a new Source with the given random seed. Using the same seed should give the same series of events on a given version of Go.
func (*UserSource) Record ¶
func (s *UserSource) Record() (interface{}, error)
Record implements pdk.Source and returns a randomly generated user.