safebatcher

package
v0.0.0-...-c7991bf Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

type Batch struct {
	Queries []interface{}
	Path    string
	// contains filtered or unexported fields
}

type BatchSubscriber

type BatchSubscriber struct {
	// contains filtered or unexported fields
}

type Config

type Config struct {
	MaxBatchSize int
	MaxLatency   time.Duration
	IdleTimeout  time.Duration
}

type PredictionRequestBatcher

type PredictionRequestBatcher struct {
	sync.Mutex

	MaxBatchSize int
	MaxLatency   time.Duration
	IdleTimeout  time.Duration
	// contains filtered or unexported fields
}

func NewPredictionRequestBatcher

func NewPredictionRequestBatcher(
	ctx context.Context,
	config *Config,
	next http.Handler,
) *PredictionRequestBatcher

func (*PredictionRequestBatcher) ServeHTTP

type PredictionResponse

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

type Request

type Request struct {
	Queries []interface{} `json:"queries"`
}

type Response

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

Jump to

Keyboard shortcuts

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