Documentation
¶
Index ¶
- func MustDo(method, urlStr string, body string) *httpResponse
- func MustMarshalJSON(v interface{}) []byte
- func MustNewHTTPRequest(method, urlStr string, body io.Reader) *gohttp.Request
- func NewBufferLogger() *bufferLogger
- func OptAllowedOrigins(origins []string) server.CommandOption
- func TestField_SetCacheSize(t *testing.T)
- type Cluster
- func (c Cluster) Close() error
- func (c Cluster) CreateField(t testing.TB, index string, iopts pilosa.IndexOptions, field string, ...) *pilosa.Field
- func (c Cluster) ImportBits(t testing.TB, index, field string, rowcols [][2]uint64)
- func (c Cluster) Query(t testing.TB, index, query string) pilosa.QueryResponse
- func (c Cluster) Start() error
- type Command
- func (m *Command) Client() *http.InternalClient
- func (m *Command) Close() error
- func (m *Command) GossipAddress() string
- func (m *Command) MustCreateField(tb testing.TB, index, field string, opts ...pilosa.FieldOption) *pilosa.Field
- func (m *Command) MustCreateIndex(tb testing.TB, name string, opts pilosa.IndexOptions) *pilosa.Index
- func (m *Command) MustQuery(tb testing.TB, req *pilosa.QueryRequest) pilosa.QueryResponse
- func (m *Command) MustRecalculateCaches(tb testing.TB)
- func (m *Command) Query(index, rawQuery, query string) (string, error)
- func (m *Command) RecalculateCaches() error
- func (m *Command) Reopen() error
- func (m *Command) URL() string
- type Field
- type Holder
- func (h *Holder) ClearBit(index, field string, rowID, columnID uint64)
- func (h *Holder) Close() error
- func (h *Holder) MustCreateIndexIfNotExists(index string, opt pilosa.IndexOptions) *Index
- func (h *Holder) MustSetBits(index, field string, rowID uint64, columnIDs ...uint64)
- func (h *Holder) ReadRow(index, field string, rowID uint64) *pilosa.Row
- func (h *Holder) Reopen() error
- func (h *Holder) Row(index, field string, rowID uint64) *pilosa.Row
- func (h *Holder) RowAttrStore(index, field string) pilosa.AttrStore
- func (h *Holder) RowTime(index, field string, rowID uint64, t time.Time, quantum string) *pilosa.Row
- func (h *Holder) SetBit(index, field string, rowID, columnID uint64)
- func (h *Holder) SetBitTime(index, field string, rowID, columnID uint64, t *time.Time)
- type Index
- type ModHasher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustMarshalJSON ¶ added in v0.5.0
func MustMarshalJSON(v interface{}) []byte
MustMarshalJSON marshals v to JSON. Panic on error.
func MustNewHTTPRequest ¶ added in v0.5.0
MustNewHTTPRequest creates a new HTTP request. Panic on error.
func NewBufferLogger ¶ added in v0.9.0
func NewBufferLogger() *bufferLogger
NewBufferLogger returns a new instance of BufferLogger.
func OptAllowedOrigins ¶ added in v1.0.0
func OptAllowedOrigins(origins []string) server.CommandOption
func TestField_SetCacheSize ¶ added in v1.0.0
Ensure field can set its cache
Types ¶
type Cluster ¶ added in v1.0.0
type Cluster []*Command
Cluster represents a Pilosa cluster (multiple Command instances)
func MustNewCluster ¶ added in v1.0.0
MustNewCluster creates a new cluster
func MustRunCluster ¶ added in v1.0.0
MustRunCluster creates and starts a new cluster
func (Cluster) CreateField ¶ added in v1.2.0
func (c Cluster) CreateField(t testing.TB, index string, iopts pilosa.IndexOptions, field string, fopts ...pilosa.FieldOption) *pilosa.Field
CreateField creates the index (if necessary) and field specified.
func (Cluster) ImportBits ¶ added in v1.2.0
type Command ¶ added in v1.0.0
////////////////////////////////////////////////////////////////////////////////// Command represents a test wrapper for server.Command.
func MustRunCommand ¶ added in v1.0.0
func MustRunCommand() *Command
MustRunCommand returns a new, running Main. Panic on error.
func NewCommandNode ¶ added in v1.0.0
func NewCommandNode(isCoordinator bool, opts ...server.CommandOption) *Command
NewCommandNode returns a new instance of Command with clustering enabled.
func (*Command) Client ¶ added in v1.0.0
func (m *Command) Client() *http.InternalClient
Client returns a client to connect to the program.
func (*Command) Close ¶ added in v1.0.0
Close closes the program and removes the underlying data directory.
func (*Command) GossipAddress ¶ added in v1.0.0
GossipAddress returns the address on which gossip is listening after a Main has been setup. Useful to pass as a seed to other nodes when creating and testing clusters.
func (*Command) MustCreateField ¶ added in v1.1.0
func (m *Command) MustCreateField(tb testing.TB, index, field string, opts ...pilosa.FieldOption) *pilosa.Field
MustCreateField uses this command's API to create the field. The index must already exist - it fails the test if there is an error.
func (*Command) MustCreateIndex ¶ added in v1.1.0
func (m *Command) MustCreateIndex(tb testing.TB, name string, opts pilosa.IndexOptions) *pilosa.Index
MustCreateIndex uses this command's API to create an index and fails the test if there is an error.
func (*Command) MustQuery ¶ added in v1.1.0
func (m *Command) MustQuery(tb testing.TB, req *pilosa.QueryRequest) pilosa.QueryResponse
MustQuery uses this command's API to execute the given query request, failing if Query returns a non-nil error, otherwise returning the QueryResponse.
func (*Command) MustRecalculateCaches ¶ added in v1.1.0
MustRecalculateCaches calls RecalculateCaches on the command's API, and fails if there is an error.
func (*Command) Query ¶ added in v1.0.0
Query executes a query against the program through the HTTP API.
func (*Command) RecalculateCaches ¶ added in v1.0.0
RecalculateCaches is deprecated. Use MustRecalculateCaches.
type Holder ¶ added in v0.5.0
Holder is a test wrapper for pilosa.Holder.
func MustOpenHolder ¶ added in v0.5.0
func MustOpenHolder() *Holder
MustOpenHolder creates and opens a holder at a temporary path. Panic on error.
func NewHolder ¶ added in v0.5.0
func NewHolder() *Holder
NewHolder returns a new instance of Holder with a temporary path.
func (*Holder) MustCreateIndexIfNotExists ¶ added in v0.5.0
func (h *Holder) MustCreateIndexIfNotExists(index string, opt pilosa.IndexOptions) *Index
MustCreateIndexIfNotExists returns a given index. Panic on error.
func (*Holder) MustSetBits ¶ added in v1.0.0
MustSetBits sets columns on a row. Panic on error. This function does not accept a timestamp or quantum.
func (*Holder) ReadRow ¶ added in v1.2.0
ReadRow returns a Row for a given field. If the field does not exist, it panics rather than creating the field.
func (*Holder) Reopen ¶ added in v0.5.0
Reopen instantiates and opens a new holder. Note that the holder must be Closed first.
func (*Holder) RowAttrStore ¶ added in v1.0.0
type Index ¶ added in v0.5.0
Index represents a test wrapper for pilosa.Index.
func MustOpenIndex ¶ added in v0.5.0
func MustOpenIndex() *Index
MustOpenIndex returns a new, opened index at a temporary path. Panic on error.
func (*Index) CreateField ¶ added in v1.0.0
CreateField creates a field with the given options.
func (*Index) CreateFieldIfNotExists ¶ added in v1.0.0
CreateFieldIfNotExists creates a field with the given options if it doesn't exist.