server

package
v0.0.0-...-11fc026 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMux

func NewMux(config Config, context command.ExecutionContext, hook Hook) (*http.ServeMux, error)

Types

type Config

type Config struct {
	Port          int    `yaml:"port"`
	Timeout       int    `yaml:"timeout"`
	StaticDir     string `yaml:"static_dir"`
	JSONIngestion bool   `yaml:"json_ingestion"`
	HTTPIngestion bool   `yaml:"enable_http_ingestion"`
}

type Constraint

type Constraint struct {
	Not      *Constraint  `json:"not,omitempty"`
	All      []Constraint `json:"all,omitempty"`
	Any      []Constraint `json:"any,omitempty"`
	KeyIs    *KeyIs       `json:"key_is,omitempty"`
	KeyIn    *KeyIn       `json:"key_in,omitempty"`
	KeyMatch *KeyMatch    `json:"key_match,omitempty"`
}

type HTTPError

type HTTPError interface {
	error
	ErrorCode() int
}

HTTPError indicates that an error should override the return code.

type Hook

type Hook struct {
	OnQuery chan<- *inspect.Profiler
}

type IngestRequest

type IngestRequest struct {
	Name string            `json:"name"`
	Tags map[string]string `json:"tags"`
}

type KeyIn

type KeyIn struct {
	Key    string   `json:"key"`
	Values []string `json:"values"`
}

type KeyIs

type KeyIs struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type KeyMatch

type KeyMatch struct {
	Key   string `json:"key"`
	Regex string `json:"regex"`
}

type QueryForm

type QueryForm struct {
	Input       string      `query:"query" json:"query"`     // query to execute.
	Profile     bool        `query:"profile" json:"profile"` // if true, then profile information will be exposed to the user.
	Constraints *Constraint `query:"-" json:"where"`
}

type QueryResponse

type QueryResponse struct {
	Name     string                 `json:"name,omitempty"`
	Body     interface{}            `json:"body,omitempty"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

type Response

type Response struct {
	Success bool   `json:"success"`
	Message string `json:"message,omitempty"`
	QueryResponse
	Profile []inspect.Profile `json:"profile,omitempty"`
}

Jump to

Keyboard shortcuts

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