controllers

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SleepTime    = time.Microsecond * 100
	MaxBatchSize = 32
	MaxLatency   = 5000
)

Variables

This section is empty.

Functions

func Config

func Config(port string, svcHost string, svcPort string,
	maxBatchSize int, maxLatency int, timeout int)

func GenerateUUID

func GenerateUUID() string

func GetNowTime

func GetNowTime() time.Time

Types

type BatcherInfo

type BatcherInfo struct {
	MaxBatchSize    int
	MaxLatency      int
	Port            string
	SvcHost         string
	SvcPort         string
	Timeout         time.Duration
	Path            string
	ContentType     string
	BatchID         string
	Instances       []interface{}
	Predictions     Predictions
	Info            map[*context.Context]InputInfo
	Start           time.Time
	Now             time.Time
	CurrentInputLen int
}

func (*BatcherInfo) BatchPredict

func (batcherInfo *BatcherInfo) BatchPredict()

func (*BatcherInfo) Batcher

func (batcherInfo *BatcherInfo) Batcher()

func (*BatcherInfo) CallService

func (batcherInfo *BatcherInfo) CallService() *string

func (*BatcherInfo) Consume

func (batcherInfo *BatcherInfo) Consume()

func (*BatcherInfo) InitializeInfo

func (batcherInfo *BatcherInfo) InitializeInfo()

type Input

type Input struct {
	ContextInput *context.Context
	Instances    *[]interface{}
	ChannelOut   *chan Response
}

type InputInfo

type InputInfo struct {
	ChannelOut *chan Response
	Index      []int
}

type MainController

type MainController struct {
	beego.Controller
}

func (*MainController) Post

func (c *MainController) Post()

type Predictions

type Predictions struct {
	Predictions []interface{} `json:"predictions"`
}

type Request

type Request struct {
	Instances []interface{} `json:"instances"`
}

type Response

type Response struct {
	Message     string        `json:"message"`
	BatchID     string        `json:"batchId"`
	Predictions []interface{} `json:"predictions"`
}

type ResponseError

type ResponseError struct {
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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