api

package
v0.0.0-...-1b9946f Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: Apache-2.0, MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterFilter

func RegisterFilter(server *otohttp.Server, filter Filter)

Types

type Filter

type Filter interface {
	Classify(context.Context, Label) (*Label, error)
	Sample(context.Context, SampleRequest) (*SampleResponse, error)
}

func NewFilterClient

func NewFilterClient(
	endpoint string,
	options ...*FilterClientOptions,
) Filter

func NewFilterClientFromOptions

func NewFilterClientFromOptions(opts base.ServiceOptions) Filter

type FilterClientOptions

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

func NewFilterClientOptions

func NewFilterClientOptions() *FilterClientOptions

func (*FilterClientOptions) SetBasicAuth

func (o *FilterClientOptions) SetBasicAuth(username, password string) *FilterClientOptions

func (*FilterClientOptions) SetTimeout

func (o *FilterClientOptions) SetTimeout(timeout time.Duration) *FilterClientOptions

func (*FilterClientOptions) SetTransport

func (o *FilterClientOptions) SetTransport(transport http.RoundTripper) *FilterClientOptions

type Label

type Label struct {
	ID        string                 `json:"id"`
	GadgetID  string                 `json:"gadgetID"`
	ProjectID string                 `json:"projectID"`
	Comment   string                 `json:"comment"`
	Deleted   *time.Time             `json:"deleted"`
	DeleterID string                 `json:"deleterID"`
	CreatorID string                 `json:"creatorID"`
	Created   *time.Time             `json:"created"`
	Parent    *Label                 `json:"parent"`
	Payload   map[string]interface{} `json:"payload"`
	Tags      []string               `json:"tags"`
	Seek      time.Duration          `json:"seek"`
	Pad       time.Duration          `json:"pad"`
	Error     string                 `json:"error,omitempty"`
}

func NewLabelFromMap

func NewLabelFromMap(p map[string]interface{}) *Label

func (*Label) MarshalJSON

func (m *Label) MarshalJSON() ([]byte, error)

func (*Label) UnmarshalJSON

func (m *Label) UnmarshalJSON(body []byte) error

type SampleRequest

type SampleRequest struct {
	ProjectID string `json:"projectID"`
	BatchSize int    `json:"batchSize"`
}

type SampleResponse

type SampleResponse struct {
	Labels []*Label `json:"labels"`
	Error  string   `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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