Documentation ¶
Index ¶
- Constants
- func GetHTTPClient(t *tls.Config) *http.Client
- func NewTranslateStore(node interface{}) pilosa.TranslateStore
- func OptHandlerAPI(api *pilosa.API) handlerOption
- func OptHandlerAllowedOrigins(origins []string) handlerOption
- func OptHandlerCloseTimeout(d time.Duration) handlerOption
- func OptHandlerListener(ln net.Listener) handlerOption
- func OptHandlerLogger(logger logger.Logger) handlerOption
- type Bits
- func (p Bits) ColumnIDs() []uint64
- func (p Bits) ColumnKeys() []string
- func (p Bits) GroupByShard() map[uint64][]pilosa.Bit
- func (p Bits) HasColumnKeys() bool
- func (p Bits) HasRowKeys() bool
- func (p Bits) Len() int
- func (p Bits) Less(i, j int) bool
- func (p Bits) RowIDs() []uint64
- func (p Bits) RowKeys() []string
- func (p Bits) Swap(i, j int)
- func (p Bits) Timestamps() []int64
- type BitsByPos
- type Error
- type FieldValues
- func (p FieldValues) ColumnIDs() []uint64
- func (p FieldValues) ColumnKeys() []string
- func (p FieldValues) GroupByShard() map[uint64][]pilosa.FieldValue
- func (p FieldValues) HasColumnKeys() bool
- func (p FieldValues) Len() int
- func (p FieldValues) Less(i, j int) bool
- func (p FieldValues) Swap(i, j int)
- func (p FieldValues) Values() []int64
- type Handler
- type InternalClient
- func (c *InternalClient) BlockData(ctx context.Context, uri *pilosa.URI, index, field, view string, shard uint64, ...) ([]uint64, []uint64, error)
- func (c *InternalClient) ColumnAttrDiff(ctx context.Context, uri *pilosa.URI, index string, blks []pilosa.AttrBlock) (map[uint64]map[string]interface{}, error)
- func (c *InternalClient) CreateField(ctx context.Context, index, field string) error
- func (c *InternalClient) CreateFieldWithOptions(ctx context.Context, index, field string, opt pilosa.FieldOptions) error
- func (c *InternalClient) CreateIndex(ctx context.Context, index string, opt pilosa.IndexOptions) error
- func (c *InternalClient) EnsureField(ctx context.Context, indexName string, fieldName string) error
- func (c *InternalClient) EnsureFieldWithOptions(ctx context.Context, indexName string, fieldName string, ...) error
- func (c *InternalClient) EnsureIndex(ctx context.Context, name string, options pilosa.IndexOptions) error
- func (c *InternalClient) ExportCSV(ctx context.Context, index, field string, shard uint64, w io.Writer) error
- func (c *InternalClient) FragmentBlocks(ctx context.Context, uri *pilosa.URI, index, field, view string, shard uint64) ([]pilosa.FragmentBlock, error)
- func (c *InternalClient) FragmentNodes(ctx context.Context, index string, shard uint64) ([]*pilosa.Node, error)
- func (c *InternalClient) Import(ctx context.Context, index, field string, shard uint64, bits []pilosa.Bit, ...) error
- func (c *InternalClient) ImportK(ctx context.Context, index, field string, bits []pilosa.Bit, ...) error
- func (c *InternalClient) ImportRoaring(ctx context.Context, uri *pilosa.URI, index, field string, shard uint64, ...) error
- func (c *InternalClient) ImportValue(ctx context.Context, index, field string, shard uint64, ...) error
- func (c *InternalClient) ImportValueK(ctx context.Context, index, field string, vals []pilosa.FieldValue, ...) error
- func (c *InternalClient) MaxShardByIndex(ctx context.Context) (map[string]uint64, error)
- func (c *InternalClient) Nodes(ctx context.Context) ([]*pilosa.Node, error)
- func (c *InternalClient) Query(ctx context.Context, index string, queryRequest *pilosa.QueryRequest) (*pilosa.QueryResponse, error)
- func (c *InternalClient) QueryNode(ctx context.Context, uri *pilosa.URI, index string, ...) (*pilosa.QueryResponse, error)
- func (c *InternalClient) RetrieveShardFromURI(ctx context.Context, index, field, view string, shard uint64, uri pilosa.URI) (io.ReadCloser, error)
- func (c *InternalClient) RowAttrDiff(ctx context.Context, uri *pilosa.URI, index, field string, ...) (map[uint64]map[string]interface{}, error)
- func (c *InternalClient) Schema(ctx context.Context) ([]*pilosa.IndexInfo, error)
- func (c *InternalClient) SendMessage(ctx context.Context, uri *pilosa.URI, msg []byte) error
Constants ¶
const ( QueryResultTypeRow uint32 = iota QueryResultTypePairs QueryResultTypeUint64 )
QueryResult types.
Variables ¶
This section is empty.
Functions ¶
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. TODO (2.0) Refactor to avoid panic
func OptHandlerAPI ¶
func OptHandlerAllowedOrigins ¶
func OptHandlerAllowedOrigins(origins []string) handlerOption
func OptHandlerCloseTimeout ¶ added in v1.0.1
OptHandlerCloseTimeout controls how long to wait for the http Server to shutdown cleanly before forcibly destroying it. Default is 30 seconds.
func OptHandlerListener ¶
func OptHandlerLogger ¶
Types ¶
type Bits ¶
Bits is a slice of Bit.
func (Bits) ColumnKeys ¶
ColumnKeys returns a slice of all the column keys.
func (Bits) GroupByShard ¶
GroupByShard returns a map of bits by shard.
func (Bits) HasColumnKeys ¶ added in v1.1.0
HasColumnKeys returns true if any values use a column key.
func (Bits) HasRowKeys ¶ added in v1.1.0
HasRowKeys returns true if any values use a row key.
func (Bits) Timestamps ¶
Timestamps returns a slice of all the timestamps.
type Error ¶
type Error struct { // Human-readable message. Message string `json:"message"` }
Error defines a standard application error.
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 ¶
Handler represents an HTTP handler.
func NewHandler ¶
NewHandler returns a new instance of Handler with a default logger.
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
func (*InternalClient) CreateFieldWithOptions ¶ added in v1.2.0
func (c *InternalClient) CreateFieldWithOptions(ctx context.Context, index, field string, opt pilosa.FieldOptions) 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 (*InternalClient) EnsureFieldWithOptions ¶ added in v1.2.0
func (c *InternalClient) EnsureFieldWithOptions(ctx context.Context, indexName string, fieldName string, opt pilosa.FieldOptions) 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, opts ...pilosa.ImportOption) 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, opts ...pilosa.ImportOption) error
ImportK bulk imports bits specified by string keys to a host.
func (*InternalClient) ImportRoaring ¶ added in v1.2.0
func (c *InternalClient) ImportRoaring(ctx context.Context, uri *pilosa.URI, index, field string, shard uint64, remote bool, req *pilosa.ImportRoaringRequest) error
ImportRoaring does fast import of raw bits in roaring format (pilosa or official format, see API.ImportRoaring).
func (*InternalClient) ImportValue ¶
func (c *InternalClient) ImportValue(ctx context.Context, index, field string, shard uint64, vals []pilosa.FieldValue, opts ...pilosa.ImportOption) 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, opts ...pilosa.ImportOption) error
ImportValueK bulk imports keyed field values to a host.
func (*InternalClient) MaxShardByIndex ¶
MaxShardByIndex returns the number of shards on a server by index.
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, view string, shard uint64, uri pilosa.URI) (io.ReadCloser, error)
RetrieveShardFromURI returns a ReadCloser which contains the data of the specified shard from the specified node. Caller *must* close the returned ReadCloser or risk leaking goroutines/tcp connections.
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) SendMessage ¶
SendMessage posts a message synchronously.