http

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2018 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryResultTypeRow uint32 = iota
	QueryResultTypePairs
	QueryResultTypeUint64
)

QueryResult types.

Variables

This section is empty.

Functions

func GetHTTPClient

func GetHTTPClient(t *tls.Config) *http.Client

func NewTranslateStore

func NewTranslateStore(node interface{}) pilosa.TranslateStore

NewTranslateStore returns a new instance of TranslateStore based on node. DEPRECATED: Providing a string url to this function is being deprecated. Instead, provide a *pilosa.Node.

func OptHandlerAPI

func OptHandlerAPI(api *pilosa.API) handlerOption

func OptHandlerAllowedOrigins

func OptHandlerAllowedOrigins(origins []string) handlerOption

func OptHandlerCloseTimeout added in v1.0.1

func OptHandlerCloseTimeout(d time.Duration) handlerOption

OptHandlerCloseTimeout controls how long to wait for the http Server to shutdown cleanly before forcibly destroying it. Default is 30 seconds.

func OptHandlerListener

func OptHandlerListener(ln net.Listener) handlerOption

func OptHandlerLogger

func OptHandlerLogger(logger pilosa.Logger) handlerOption

Types

type Bits

type Bits []pilosa.Bit

Bits is a slice of Bit.

func (Bits) ColumnIDs

func (p Bits) ColumnIDs() []uint64

ColumnIDs returns a slice of all the column IDs.

func (Bits) ColumnKeys

func (p Bits) ColumnKeys() []string

ColumnKeys returns a slice of all the column keys.

func (Bits) GroupByShard

func (p Bits) GroupByShard() map[uint64][]pilosa.Bit

GroupByShard returns a map of bits by shard.

func (Bits) HasColumnKeys added in v1.1.0

func (p Bits) HasColumnKeys() bool

HasColumnKeys returns true if any values use a column key.

func (Bits) HasRowKeys added in v1.1.0

func (p Bits) HasRowKeys() bool

HasRowKeys returns true if any values use a row key.

func (Bits) Len

func (p Bits) Len() int

func (Bits) Less

func (p Bits) Less(i, j int) bool

func (Bits) RowIDs

func (p Bits) RowIDs() []uint64

RowIDs returns a slice of all the row IDs.

func (Bits) RowKeys

func (p Bits) RowKeys() []string

RowKeys returns a slice of all the row keys.

func (Bits) Swap

func (p Bits) Swap(i, j int)

func (Bits) Timestamps

func (p Bits) Timestamps() []int64

Timestamps returns a slice of all the timestamps.

type BitsByPos

type BitsByPos []pilosa.Bit

BitsByPos is a slice of bits sorted row then column.

func (BitsByPos) Len

func (p BitsByPos) Len() int

func (BitsByPos) Less

func (p BitsByPos) Less(i, j int) bool

func (BitsByPos) Swap

func (p BitsByPos) Swap(i, j int)

type Error

type Error struct {
	// Human-readable message.
	Message string `json:"message"`
}

Error defines a standard application error.

func (*Error) Error

func (e *Error) Error() string

Error returns the string representation of the error message.

type FieldValues

type FieldValues []pilosa.FieldValue

FieldValues represents a slice of field values.

func (FieldValues) ColumnIDs

func (p FieldValues) ColumnIDs() []uint64

ColumnIDs returns a slice of all the column IDs.

func (FieldValues) ColumnKeys added in v1.1.0

func (p FieldValues) ColumnKeys() []string

ColumnKeys returns a slice of all the column keys.

func (FieldValues) GroupByShard

func (p FieldValues) GroupByShard() map[uint64][]pilosa.FieldValue

GroupByShard returns a map of field values by shard.

func (FieldValues) HasColumnKeys added in v1.1.0

func (p FieldValues) HasColumnKeys() bool

HasColumnKeys returns true if any values use a column key.

func (FieldValues) Len

func (p FieldValues) Len() int

func (FieldValues) Less

func (p FieldValues) Less(i, j int) bool

func (FieldValues) Swap

func (p FieldValues) Swap(i, j int)

func (FieldValues) Values

func (p FieldValues) Values() []int64

Values returns a slice of all the values.

type Handler

type Handler struct {
	Handler http.Handler
	// contains filtered or unexported fields
}

Handler represents an HTTP handler.

func NewHandler

func NewHandler(opts ...handlerOption) (*Handler, error)

NewHandler returns a new instance of Handler with a default logger.

func (*Handler) Close

func (h *Handler) Close() error

Close tries to cleanly shutdown the HTTP server, and failing that, after a timeout, calls Server.Close.

func (*Handler) Serve

func (h *Handler) Serve() error

func (*Handler) ServeHTTP

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

ServeHTTP handles an HTTP request.

type InternalClient

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

InternalClient represents a client to the Pilosa cluster.

func NewInternalClient

func NewInternalClient(host string, remoteClient *http.Client) (*InternalClient, error)

NewInternalClient returns a new instance of InternalClient to connect to host.

func NewInternalClientFromURI

func NewInternalClientFromURI(defaultURI *pilosa.URI, remoteClient *http.Client) *InternalClient

func (*InternalClient) BlockData

func (c *InternalClient) BlockData(ctx context.Context, uri *pilosa.URI, index, field, view string, shard uint64, block int) ([]uint64, []uint64, error)

BlockData returns row/column id pairs for a block.

func (*InternalClient) ColumnAttrDiff

func (c *InternalClient) ColumnAttrDiff(ctx context.Context, uri *pilosa.URI, index string, blks []pilosa.AttrBlock) (map[uint64]map[string]interface{}, error)

ColumnAttrDiff returns data from differing blocks on a remote host.

func (*InternalClient) CreateField

func (c *InternalClient) CreateField(ctx context.Context, index, field string) error

CreateField creates a new field on the server.

func (*InternalClient) CreateIndex

func (c *InternalClient) CreateIndex(ctx context.Context, index string, opt pilosa.IndexOptions) error

CreateIndex creates a new index on the server.

func (*InternalClient) EnsureField

func (c *InternalClient) EnsureField(ctx context.Context, indexName string, fieldName string) error

func (*InternalClient) EnsureIndex

func (c *InternalClient) EnsureIndex(ctx context.Context, name string, options pilosa.IndexOptions) error

func (*InternalClient) ExportCSV

func (c *InternalClient) ExportCSV(ctx context.Context, index, field string, shard uint64, w io.Writer) error

ExportCSV bulk exports data for a single shard from a host to CSV format.

func (*InternalClient) FragmentBlocks

func (c *InternalClient) FragmentBlocks(ctx context.Context, uri *pilosa.URI, index, field, view string, shard uint64) ([]pilosa.FragmentBlock, error)

FragmentBlocks returns a list of block checksums for a fragment on a host. Only returns blocks which contain data.

func (*InternalClient) FragmentNodes

func (c *InternalClient) FragmentNodes(ctx context.Context, index string, shard uint64) ([]*pilosa.Node, error)

FragmentNodes returns a list of nodes that own a shard.

func (*InternalClient) Import

func (c *InternalClient) Import(ctx context.Context, index, field string, shard uint64, bits []pilosa.Bit) error

Import bulk imports bits for a single shard to a host.

func (*InternalClient) ImportK

func (c *InternalClient) ImportK(ctx context.Context, index, field string, bits []pilosa.Bit) error

ImportK bulk imports bits specified by string keys to a host.

func (*InternalClient) ImportValue

func (c *InternalClient) ImportValue(ctx context.Context, index, field string, shard uint64, vals []pilosa.FieldValue) error

ImportValue bulk imports field values for a single shard to a host.

func (*InternalClient) ImportValueK added in v1.1.0

func (c *InternalClient) ImportValueK(ctx context.Context, index, field string, vals []pilosa.FieldValue) error

ImportValueK bulk imports keyed field values to a host.

func (*InternalClient) MaxShardByIndex

func (c *InternalClient) MaxShardByIndex(ctx context.Context) (map[string]uint64, error)

MaxShardByIndex returns the number of shards on a server by index.

func (*InternalClient) Nodes added in v1.1.0

func (c *InternalClient) Nodes(ctx context.Context) ([]*pilosa.Node, error)

Nodes returns a list of all nodes.

func (*InternalClient) Query

func (c *InternalClient) Query(ctx context.Context, index string, queryRequest *pilosa.QueryRequest) (*pilosa.QueryResponse, error)

Query executes query against the index.

func (*InternalClient) QueryNode

func (c *InternalClient) QueryNode(ctx context.Context, uri *pilosa.URI, index string, queryRequest *pilosa.QueryRequest) (*pilosa.QueryResponse, error)

QueryNode executes query against the index, sending the request to the node specified.

func (*InternalClient) RetrieveShardFromURI

func (c *InternalClient) RetrieveShardFromURI(ctx context.Context, index, field string, shard uint64, uri pilosa.URI) (io.ReadCloser, error)

func (*InternalClient) RowAttrDiff

func (c *InternalClient) RowAttrDiff(ctx context.Context, uri *pilosa.URI, index, field string, blks []pilosa.AttrBlock) (map[uint64]map[string]interface{}, error)

RowAttrDiff returns data from differing blocks on a remote host.

func (*InternalClient) Schema

func (c *InternalClient) Schema(ctx context.Context) ([]*pilosa.IndexInfo, error)

Schema returns all index and field schema information.

func (*InternalClient) SendMessage

func (c *InternalClient) SendMessage(ctx context.Context, uri *pilosa.URI, msg []byte) error

SendMessage posts a message synchronously.

Jump to

Keyboard shortcuts

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