httpd

package
v0.0.0-...-5dff866 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2016 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultChunkSize specifies the amount of data mappers will read
	// up to, before sending results back to the engine. This is the
	// default size in the number of values returned in a raw query.
	//
	// Could be many more bytes depending on fields returned.
	DefaultChunkSize = 10000
)

Variables

This section is empty.

Functions

func MarshalJSON

func MarshalJSON(v interface{}, pretty bool) []byte

MarshalJSON will marshal v to JSON. Pretty prints if pretty is true.

Types

type AuthenticationRequest

type AuthenticationRequest struct {
	Username  string `json:"username"`
	Password  string `json:"password"`
	GrantType string `json:"grant_type"`
}

AuthenticationRequest defines an inbound authentication req

type Config

type Config struct {
	Enabled      bool   `toml:"enabled"`
	BindAddress  string `toml:"bind-address"`
	AuthEnabled  bool   `toml:"auth-enabled"`
	LogEnabled   bool   `toml:"log-enabled"`
	WriteTracing bool   `toml:"write-tracing"`
	PprofEnabled bool   `toml:"pprof-enabled"`
}

Config represents a configuration for a HTTP service.

func NewConfig

func NewConfig() Config

NewConfig returns a new Config with default settings.

type Feature

type Feature struct {
	ID                      string
	Name                    string
	GlobPermissions         bool
	RequiredPermissionLevel string
	GlobAvailable           bool
}

Feature describes additional beta and rollback features in a component livecycle

type Handler

type Handler struct {
	Version string

	Logger *log.Logger

	WriteTrace    bool // Detailed logging of write path
	Mongo         *mgo.Database
	Elasticsearch *elastigo.Conn
	Cassandra     *gocql.ClusterConfig

	Feature *Feature
	// contains filtered or unexported fields
}

Handler represents an HTTP handler for the InfluxDB server.

func NewHandler

func NewHandler(requireAuthentication, loggingEnabled, writeTrace bool) *Handler

NewHandler returns a new instance of handler with routes.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Handler) SetRoutes

func (h *Handler) SetRoutes(routes []route)

SetRoutes sets the provided routes on the handler.

type PasswordChangeRequest

type PasswordChangeRequest struct {
	NewPassword             string `json:"new_password"`
	NewPasswordConfirmation string `json:"new_password_confirmation"`
	OldPassword             string `json:"old_password"`
}

PasswordChangeRequest defines an inbound authentication req

type Response

type Response struct {
	Results []interface{} `json:"results"`
	Err     string        `json:"error"`
}

Response represents a list of statement results.

func (*Response) Error

func (r *Response) Error() error

Error returns the first error from any statement. Returns nil if no errors occurred on any statements.

func (Response) MarshalJSON

func (r Response) MarshalJSON() ([]byte, error)

MarshalJSON encodes a Response struct into JSON.

func (*Response) UnmarshalJSON

func (r *Response) UnmarshalJSON(b []byte) error

UnmarshalJSON decodes the data into the Response struct

type Result

type Result struct {
	Entity interface{}
	Err    error
}

type RootAPIResult

type RootAPIResult struct {
	AppName      string                   `json:"app"`
	Version      string                   `json:"version"`
	AllowedPaths []map[string]interface{} `json:"paths"`
}

RootAPIResult describes the API Result of the Root Document

type Service

type Service struct {
	Handler *Handler

	Logger *log.Logger
	// contains filtered or unexported fields
}

Service manages the listener and handler for an HTTP endpoint.

func NewService

func NewService(c Config) *Service

NewService returns a new instance of Service.

func (*Service) Addr

func (s *Service) Addr() net.Addr

Addr returns the listener's address. Returns nil if listener is closed.

func (*Service) Close

func (s *Service) Close() error

Close closes the underlying listener.

func (*Service) Err

func (s *Service) Err() <-chan error

Err returns a channel for fatal errors that occur on the listener.

func (*Service) Open

func (s *Service) Open() error

Open starts the service

func (*Service) SetLogger

func (s *Service) SetLogger(l *log.Logger)

SetLogger sets the internal logger to the logger passed in.

type SettingsUpdateRequest

type SettingsUpdateRequest struct {
	Values map[string]string `json:"values"`
}

SettingsUpdateRequest defines an inbound settings update req

Jump to

Keyboard shortcuts

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