Documentation ¶
Index ¶
- Constants
- type AuthResponse
- type Batch
- func (b *Batch) Authenticate(username, password string) (*AuthResponse, error)
- func (b *Batch) CreateCollection() error
- func (b *Batch) CreateDestination(dstType string) error
- func (b *Batch) CreateReplay() error
- func (b *Batch) Get(path string, queryParams map[string]string) ([]byte, int, error)
- func (b *Batch) ListCollections() error
- func (b *Batch) ListDestinations() error
- func (b *Batch) ListReplays() error
- func (b *Batch) ListSchemas() error
- func (b *Batch) LoadConfig()
- func (b *Batch) Login() error
- func (b *Batch) Logout() error
- func (b *Batch) Post(path string, params map[string]interface{}) ([]byte, int, error)
- func (b *Batch) SearchCollection() error
- type BlunderError
- type BlunderErrorResponse
- type Collection
- type CollectionOutput
- type CollectionSchema
- type Config
- type DataLake
- type DestinationOutput
- type IBatch
- type PrinterFunc
- type Replay
- type ReplayCollection
- type ReplayDestination
- type ReplayOutput
- type SchemaOutput
- type SearchResult
Constants ¶
const ( EnterKey = byte(10) PageSize = 25 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthResponse ¶
type AuthResponse struct { AccountID string `json:"id"` Name string `json:"name"` Email string `json:"email"` OnboardingState string `json:"onboarding_state"` OnboardingStateStatus string `json:"onboarding_state_status"` Team struct { ID string `json:"id"` Name string `json: "name"` } }
AuthResponse is used to unmarshal the JSON results of a login API call
type Batch ¶
type Batch struct { Token string TeamID string UserID string Log *logrus.Entry Opts *cli.Options Client *http.Client Printer PrinterFunc ApiUrl string }
func (*Batch) Authenticate ¶
func (b *Batch) Authenticate(username, password string) (*AuthResponse, error)
Authenticate makes an API call to the Batch.sh API with the given account's credentials
func (*Batch) CreateCollection ¶
func (*Batch) CreateDestination ¶
func (*Batch) CreateReplay ¶
func (*Batch) ListCollections ¶
ListCollections lists all of an account's collections
func (*Batch) ListDestinations ¶
ListDestinations lists all of an account's replay destinations
func (*Batch) ListReplays ¶
ListReplays lists all of an account's replays
func (*Batch) ListSchemas ¶
ListSchemas lists all of an account's schemas
func (*Batch) Login ¶
Login attempts to login to the Batch.sh API using credentials supplied via stdin
func (*Batch) SearchCollection ¶
SearchCollection queries a collection
type BlunderError ¶
type BlunderErrorResponse ¶
type BlunderErrorResponse struct {
Errors []*BlunderError `json:"errors"`
}
type Collection ¶
type Collection struct { ID string `json:"id" header:"ID"` Name string `json:"name" header:"Name"` Token string `json:"token"` Paused bool `json:"paused" header:"Is Paused?"` *CollectionSchema `json:"schema"` }
Collection is used to unmarshal the JSON results of a list collections API call
type CollectionOutput ¶
type CollectionOutput struct { Name string `header:"Name"` ID string `header:"ID"` Token string `header:"Token"` Paused bool `header:"Is Paused"` SchemaName string `header:"Schema Name"` SchemaType string `header:"Schema Type"` }
CollectionOutput is used for displaying collections as a table
type CollectionSchema ¶
type CollectionSchema struct { ID string `json:"id,omitempty"` Name string `json:"name" header:"Schema"` Type string `json:"type"` }
CollectionSchema is used to unmarshal the JSON results of a list collections API call
type Config ¶
type Config struct { Token string `json:"token"` TeamID string `json:"team_id"` UserID string `json:"user_id"` }
Config stores Account IDs and the auth_token cookie
type DestinationOutput ¶
type DestinationOutput struct { Name string `json:"name" header:"Name"` ID string `json:"id" header:"Destination ID"` Type string `json:"type" header:"Type""` Archived bool `json:"archived" header:"Is Archived"` }
DestinationOutput is used for displaying destinations as a table
type IBatch ¶
type IBatch interface { LoadConfig() Login() error Logout() error ListReplays() error ListCollections() error ListSchemas() error ListDestinations() error Get(path string, queryParams map[string]string) (content []byte, statusCode int, err error) Post(path string, params map[string]interface{}) (content []byte, statusCode int, err error) }
type PrinterFunc ¶
type PrinterFunc func(v interface{})
PrinterFunc is a function that will be used to display output to the user's console
type Replay ¶
type Replay struct { ID string `header:"Replay ID" json:"id"` Name string `header:"Name" json:"name"` Type string `header:"Type" json:"type"` Query string `header:"Query" json:"query"` Paused bool `header:"Is Paused" json:"paused"` *ReplayDestination `json:"destination"` *ReplayCollection `json:"collection"` }
Replay is used to unmarshal the JSON results of a list replays API call
type ReplayCollection ¶
type ReplayCollection struct {
Name string `db:"collection_name" json:"name"`
}
ReplayCollection is used to unmarshal the JSON results of a list replays API call
type ReplayDestination ¶
type ReplayDestination struct {
Name string `db:"destination_name" json:"name"`
}
ReplayDestination is used to unmarshal the JSON results of a list replays API call
type ReplayOutput ¶
type ReplayOutput struct { Name string `header:"Name" json:"name"` ID string `header:"Replay ID" json:"id"` Type string `header:"Type" json:"type"` Query string `header:"Query" json:"query"` Collection string `header:"Collection Name"` Destination string `header:"Destination Name"` Paused bool `header:"Is Paused" json:"paused"` }
ReplayOutput is used for displaying replays as a table
type SchemaOutput ¶
type SchemaOutput struct { Name string `header:"Name" json:"name"` ID string `header:"Schema ID" json:"id"` Type string `header:"Type" json:"type"` RootType string `header:"Protobuf Root Type" json:"root_type"` Archived bool `header:"Is Archived" json:"archived"` }
SchemaOutput is used for displaying schemas as a table
type SearchResult ¶
type SearchResult struct { Total int `json:"total"` Data []json.RawMessage `json:"data"` }
SearchResult is used to unmarshal the JSON results of a search API call