mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
Remove some dead code
This commit is contained in:
parent
3b898bf801
commit
da4cd84820
5 changed files with 0 additions and 63 deletions
|
|
@ -27,19 +27,12 @@ import (
|
|||
"sort"
|
||||
"strconv"
|
||||
|
||||
"crypto/tls"
|
||||
|
||||
"github.com/gogo/protobuf/proto"
|
||||
"github.com/pilosa/pilosa"
|
||||
"github.com/pilosa/pilosa/internal"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// ClientOptions represents the configuration for a InternalHTTPClient
|
||||
type ClientOptions struct {
|
||||
TLS *tls.Config
|
||||
}
|
||||
|
||||
// InternalClient represents a client to the Pilosa cluster.
|
||||
type InternalClient struct {
|
||||
defaultURI *pilosa.URI
|
||||
|
|
@ -70,9 +63,6 @@ func NewInternalClientFromURI(defaultURI *pilosa.URI, remoteClient *http.Client)
|
|||
}
|
||||
}
|
||||
|
||||
// Host returns the host the client was initialized with.
|
||||
func (c *InternalClient) Host() *pilosa.URI { return c.defaultURI }
|
||||
|
||||
// MaxShardByIndex returns the number of shards on a server by index.
|
||||
func (c *InternalClient) MaxShardByIndex(ctx context.Context) (map[string]uint64, error) {
|
||||
return c.maxShardByIndex(ctx)
|
||||
|
|
|
|||
|
|
@ -1329,10 +1329,6 @@ func (h *Handler) handlePostClusterMessage(w http.ResponseWriter, r *http.Reques
|
|||
}
|
||||
}
|
||||
|
||||
func (h *Handler) GetAPI() *pilosa.API {
|
||||
return h.API
|
||||
}
|
||||
|
||||
type defaultClusterMessageResponse struct{}
|
||||
|
||||
func (h *Handler) handleGetTranslateData(w http.ResponseWriter, r *http.Request) {
|
||||
|
|
|
|||
33
pql/ast.go
33
pql/ast.go
|
|
@ -220,23 +220,6 @@ func (q *Query) WriteCallN() int {
|
|||
return n
|
||||
}
|
||||
|
||||
// HasKeys returns true if any call in the query uses keys and requires translation to ids.
|
||||
func (q *Query) HasKeys() bool {
|
||||
for _, call := range q.Calls {
|
||||
if call.Args["col"] != nil {
|
||||
if _, ok := call.Args["col"].(string); ok {
|
||||
return true
|
||||
}
|
||||
}
|
||||
if call.Args["row"] != nil {
|
||||
if _, ok := call.Args["row"].(string); ok {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// String returns a string representation of the query.
|
||||
func (q *Query) String() string {
|
||||
a := make([]string, len(q.Calls))
|
||||
|
|
@ -309,22 +292,6 @@ func (c *Call) UintSliceArg(key string) ([]uint64, bool, error) {
|
|||
}
|
||||
}
|
||||
|
||||
// StringArg is for reading the value at key from call.Args as a string. If the
|
||||
// key is not in Call.Args, the value of the returned bool will be false, and
|
||||
// the error will be nil. An error is returned if the value is not a string.
|
||||
func (c *Call) StringArg(key string) (string, bool, error) {
|
||||
val, ok := c.Args[key]
|
||||
if !ok {
|
||||
return "", false, nil
|
||||
}
|
||||
switch tval := val.(type) {
|
||||
case string:
|
||||
return tval, true, nil
|
||||
default:
|
||||
return "", true, fmt.Errorf("could not convert %v of type %T to string in Call.StringArg", tval, tval)
|
||||
}
|
||||
}
|
||||
|
||||
// Keys returns a list of argument keys in sorted order.
|
||||
func (c *Call) Keys() []string {
|
||||
a := make([]string, 0, len(c.Args))
|
||||
|
|
|
|||
|
|
@ -21,13 +21,6 @@ import (
|
|||
"github.com/pilosa/pilosa/toml"
|
||||
)
|
||||
|
||||
// Cluster types.
|
||||
const (
|
||||
ClusterNone = ""
|
||||
ClusterStatic = "static"
|
||||
ClusterGossip = "gossip"
|
||||
)
|
||||
|
||||
// TLSConfig contains TLS configuration
|
||||
type TLSConfig struct {
|
||||
// CertificatePath contains the path to the certificate (.crt or .pem file)
|
||||
|
|
|
|||
|
|
@ -81,15 +81,6 @@ func (h *Holder) MustCreateIndexIfNotExists(index string, opt pilosa.IndexOption
|
|||
return &Index{Index: idx}
|
||||
}
|
||||
|
||||
// MustCreateFieldIfNotExists returns a given field. Panic on error.
|
||||
func (h *Holder) MustCreateFieldIfNotExists(index, field string) *Field {
|
||||
f, err := h.MustCreateIndexIfNotExists(index, pilosa.IndexOptions{}).CreateFieldIfNotExists(field, pilosa.OptFieldTypeDefault())
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return f
|
||||
}
|
||||
|
||||
// Row returns a Row for a given field.
|
||||
func (h *Holder) Row(index, field string, rowID uint64) *pilosa.Row {
|
||||
idx := h.MustCreateIndexIfNotExists(index, pilosa.IndexOptions{})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue