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 ¶
func MustMarshalJSON(v interface{}) []byte
MustMarshalJSON marshals v to JSON. Panic on error.
func MustNewHTTPRequest ¶
MustNewHTTPRequest creates a new HTTP request. Panic on error.
func NewBufferLogger ¶
func NewBufferLogger() *bufferLogger
NewBufferLogger returns a new instance of BufferLogger.
func OptAllowedOrigins ¶
func OptAllowedOrigins(origins []string) server.CommandOption
func TestField_SetCacheSize ¶
Ensure field can set its cache
Types ¶
type Cluster ¶
type Cluster []*Command
Cluster represents a Pilosa cluster (multiple Command instances)
func MustNewCluster ¶
MustNewCluster creates a new cluster
func MustRunCluster ¶
MustRunCluster creates and starts a new cluster
func (Cluster) CreateField ¶
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 ¶
type Command ¶
////////////////////////////////////////////////////////////////////////////////// Command represents a test wrapper for server.Command.
func MustRunCommand ¶
func MustRunCommand() *Command
MustRunCommand returns a new, running Main. Panic on error.
func NewCommandNode ¶
func NewCommandNode(isCoordinator bool, opts ...server.CommandOption) *Command
NewCommandNode returns a new instance of Command with clustering enabled.
func (*Command) Client ¶
func (m *Command) Client() *http.InternalClient
Client returns a client to connect to the program.
func (*Command) GossipAddress ¶
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 ¶
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 ¶
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 ¶
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 ¶
MustRecalculateCaches calls RecalculateCaches on the command's API, and fails if there is an error.
func (*Command) RecalculateCaches ¶
RecalculateCaches is deprecated. Use MustRecalculateCaches.
type Holder ¶
Holder is a test wrapper for pilosa.Holder.
func MustOpenHolder ¶
func MustOpenHolder() *Holder
MustOpenHolder creates and opens a holder at a temporary path. Panic on error.
func NewHolder ¶
func NewHolder() *Holder
NewHolder returns a new instance of Holder with a temporary path.
func (*Holder) MustCreateIndexIfNotExists ¶
func (h *Holder) MustCreateIndexIfNotExists(index string, opt pilosa.IndexOptions) *Index
MustCreateIndexIfNotExists returns a given index. Panic on error.
func (*Holder) MustSetBits ¶
MustSetBits sets columns on a row. Panic on error. This function does not accept a timestamp or quantum.
func (*Holder) ReadRow ¶
ReadRow returns a Row for a given field. If the field does not exist, it panics rather than creating the field.
func (*Holder) Reopen ¶
Reopen instantiates and opens a new holder. Note that the holder must be Closed first.
type Index ¶
Index represents a test wrapper for pilosa.Index.
func MustOpenIndex ¶
func MustOpenIndex() *Index
MustOpenIndex returns a new, opened index at a temporary path. Panic on error.
func (*Index) CreateField ¶
CreateField creates a field with the given options.
func (*Index) CreateFieldIfNotExists ¶
CreateFieldIfNotExists creates a field with the given options if it doesn't exist.