Documentation ¶
Index ¶
- func CurrentTimeMicros() int64
- func GenerateDoc(spec DocumentSpec) (interface{}, error)
- func GenerateDocs(spec DocumentSpec) ([]interface{}, error)
- func GeneratePatches(num_patch int, destination string, c chan map[string]interface{}) ([]interface{}, error)
- func RandomFieldAdd(destination string, c chan map[string]interface{})
- func RandomFieldReplace(destination string, c chan map[string]interface{})
- func RandomString(n int) string
- func RecordE2ELatency(latency float64)
- func SetMaxDoc(maxDocId int)
- type AddressStruct
- type CoordinatesStruct
- type Destination
- type DocStruct
- type DocumentSpec
- type Elastic
- type FriendDetailsStruct
- type FriendStruct
- type NameStruct
- type Null
- type Rockset
- type Snowflake
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentTimeMicros ¶
func CurrentTimeMicros() int64
func GenerateDoc ¶
func GenerateDoc(spec DocumentSpec) (interface{}, error)
func GenerateDocs ¶
func GenerateDocs(spec DocumentSpec) ([]interface{}, error)
func GeneratePatches ¶
func RandomFieldAdd ¶
func RandomFieldReplace ¶
func RandomString ¶
func RecordE2ELatency ¶
func RecordE2ELatency(latency float64)
Types ¶
type AddressStruct ¶
type AddressStruct struct { Street string `faker:"oneof: 1st, 2nd, 3rd, 4th, 5th, 6th, 7th, 8th, 9th, 10th"` City string `faker:"oneof: SF, San Mateo, San Jose, Mountain View, Menlo Park, Palo Alto"` ZipCode int16 Coordinates CoordinatesStruct }
type CoordinatesStruct ¶
type Destination ¶
type Destination interface { // SendDocument sends a batch of documents to the destination. SendDocument(docs []any) error // Send a batch of patches to the destination. SendPatch(docs []any) error // GetLatestTimestamp get latest timestamp seen in the destination. GetLatestTimestamp() (time.Time, error) // ConfigureDestination is used to make any configuration changes to the destination that might be required for sending documents. ConfigureDestination() error }
Destination is where to send the generated documents to
type DocStruct ¶
type DocStruct struct { Guid string IsActive bool Balance float64 `faker:"amount"` Picture string Age int `faker:"oneof: 15, 27, 61"` Name NameStruct Company string `faker:"oneof: facebook, google, rockset, tesla, uber, lyft"` Email string `faker:"email"` Phone string `faker:"phone_number"` Address AddressStruct About string `faker:"sentence"` Registered string `faker:"timestamp"` Tags []string `faker:"slice_len=9,len=14"` Friends FriendStruct Greeting string `faker:"paragraph"` }
type DocumentSpec ¶
type Elastic ¶
type Elastic struct { Auth string URL string IndexName string Client *http.Client GeneratorIdentifier string }
Elastic contains all configurations needed to send documents to Elastic
func (*Elastic) ConfigureDestination ¶
func (*Elastic) GetLatestTimestamp ¶
GetLatestTimestamp returns the latest _event_time in Rockset
func (*Elastic) SendDocument ¶
SendDocument sends a batch of documents to Elastic
type FriendDetailsStruct ¶
type FriendDetailsStruct struct { Name NameStruct Age int `faker:"oneof: 15, 27, 61"` }
type FriendStruct ¶
type FriendStruct struct { Friend1 FriendDetailsStruct Friend2 FriendDetailsStruct Friend3 FriendDetailsStruct Friend4 FriendDetailsStruct Friend5 FriendDetailsStruct }
type NameStruct ¶
type Null ¶
type Null struct{}
Null destination for local testing
func (*Null) ConfigureDestination ¶
func (*Null) SendDocument ¶
type Rockset ¶
type Rockset struct { APIKey string APIServer string CollectionPath string Client *http.Client GeneratorIdentifier string }
Rockset contains all configurations needed to send documents to Rockset
func (*Rockset) ConfigureDestination ¶
func (*Rockset) GetLatestTimestamp ¶
GetLatestTimestamp returns the latest _event_time in Rockset
func (*Rockset) SendDocument ¶
SendDocument sends a batch of documents to Rockset
type Snowflake ¶
type Snowflake struct { Account string User string Password string Warehouse string Database string Schema string GeneratorIdentifier string StageS3BucketName string AWSRegion string Table string DBConnection *sql.DB }
Snowflake contains all configurations needed to send documents to Snowflake
func (*Snowflake) ConfigureDestination ¶
ConfigureDestination is used to make configuration changes to the Snowflake instance for sending documents.
func (*Snowflake) GetLatestTimestamp ¶
GetLatestTimestamp returns the latest _event_time in Snowflake
func (*Snowflake) SendDocument ¶
SendDocument sends a batch of documents to Snowflake