Documentation ¶
Index ¶
- func ErrorArray(errors []error) []string
- func GetRequestPayload(requestBody io.ReadCloser) []byte
- func HandlerError(w http.ResponseWriter, errs []error, status int)
- func HandlerPOST(w http.ResponseWriter, r *http.Request, p *Processor)
- func HandlerStatus(w http.ResponseWriter, r *http.Request)
- func MustMarshal(obj interface{}) []byte
- func PushRoutine(c BusClient, payload []byte, topic string, ch chan error)
- func Validate(schema string, data []byte) error
- type BusClient
- type Error
- type ErrorPush
- type Input
- type OutputDistribution
- type OutputPayload
- type Processor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorArray ¶
ErrorArray returns human readable error messages.
func GetRequestPayload ¶
func GetRequestPayload(requestBody io.ReadCloser) []byte
GetRequestPayload get request body's payload.
func HandlerError ¶
func HandlerError(w http.ResponseWriter, errs []error, status int)
HandlerError http error handler.
func HandlerPOST ¶
func HandlerPOST(w http.ResponseWriter, r *http.Request, p *Processor)
HandlerPOST http handler to invoke train pipeline.
func HandlerStatus ¶
func HandlerStatus(w http.ResponseWriter, r *http.Request)
HandlerStatus http status handler.
func PushRoutine ¶
PushRoutine pushes the message to a topic for async go-routines.
Types ¶
type Error ¶
type Error struct { // Type defines the error type. Type string // Message defines human readable error message. Message string // Details defines details of the error. Details interface{} }
Error defines the error.
type ErrorPush ¶
type ErrorPush struct { // contains error message Message string `json:"message"` // contains pipeline config Details interface{} `json:"details"` }
ErrorPush defines the errors of submitting jobs.
type Input ¶
type Input struct { // Model project ID (there may be several model projects within one cloud project). ProjectID string `json:"project_id"` // CodeHash is the model codebase ID. CodeHash string `json:"code_hash,omitempty"` // TrainID is the experiment's ID. TrainID string `json:"train_id,omitempty"` // Config is the ML pipeline config Config []interface{} `json:"pipeline_config"` }
Input defines the input payload to invoke pipeline.
type OutputDistribution ¶
type OutputDistribution struct { // Topic is the message broker topic to push payload to. Topic string }
OutputDistribution defines the output distribution config.
type OutputPayload ¶
type OutputPayload struct { Errors []string `json:"errors"` SubmittedID []string `json:"submitted_id"` }
OutputPayload defines output payload.
type Processor ¶
type Processor struct { // Type defines the execution type, either train, or predict Type string // TopicPrefix represents prefix of the topic to post the payload to. TopicPrefix string // InputJSONSchema defines the jsonschema of the input payload. InputJSONSchema string // Message bus to disctribute messages Bus BusClient }
Processor defines processor for predict pipeline.
Click to show internal directories.
Click to hide internal directories.