Documentation ¶
Index ¶
- Constants
- Variables
- type ArrayFilter
- type BaseFilter
- type BaseMetacommand
- type BaseOperation
- type Completer
- type CountOperation
- type Executor
- func (exe *Executor) ExecuteCount(ctx context.Context, op *CountOperation) (int64, error)
- func (exe *Executor) ExecuteGet(ctx context.Context, op *GetOperation) (*firestore.DocumentSnapshot, error)
- func (exe *Executor) ExecuteListCollections(ctx context.Context, cmd *MetacommandListCollections) ([]string, error)
- func (exe *Executor) ExecuteQuery(ctx context.Context, op *QueryOperation) ([]*firestore.DocumentSnapshot, error)
- type Filter
- type FloatFilter
- type GetOperation
- type IntFilter
- type Lexer
- type Metacommand
- type MetacommandListCollections
- type MetacommandPager
- type Operation
- type OperationType
- type Operator
- type OrderBy
- type OutputMode
- type ParseResult
- type Parser
- type QueryOperation
- type Repl
- type StringFilter
- type Token
- type TokenType
Constants ¶
View Source
const ( VENDOR_NAME = "maruware" APP_NAME = "fscli" HISTORY_FILE = "history" )
View Source
const ( EOF = "EOF" ILLEGAL = "ILLEGAL" GET = "GET" QUERY = "QUERY" COUNT = "COUNT" SELECT = "SELECT" WHERE = "WHERE" EQ = "=" NOT_EQ = "!=" GT = ">" GTE = ">=" LT = "<" LTE = "<=" IN = "IN" ARRAY_CONTAINS = "ARRAY_CONTAINS" ARRAY_CONTAINS_ANY = "ARRAY_CONTAINS_ANY" ORDER = "ORDER" BY = "BY" ASC = "ASC" DESC = "DESC" IDENT = "IDENT" STRING = "STRING" INT = "INT" FLOAT = "FLOAT" AND = "AND" LIMIT = "LIMIT" LBRACKET = "[" RBRACKET = "]" COMMA = "," LIST_COLLECTIONS = "LIST_COLLECTIONS" PAGER = "PAGER" )
View Source
const LongLine = "--------------------------------------------------------------------------"
View Source
const PAGE_SIZE = 100
Variables ¶
View Source
var ErrInvalidCollection = errors.New("invalid collection")
Functions ¶
This section is empty.
Types ¶
type ArrayFilter ¶ added in v0.2.0
type ArrayFilter struct { BaseFilter // contains filtered or unexported fields }
func NewArrayFilter ¶ added in v0.2.0
func NewArrayFilter(field string, operator Operator, value []any) *ArrayFilter
func (*ArrayFilter) Value ¶ added in v0.2.0
func (f *ArrayFilter) Value() any
type BaseFilter ¶
type BaseFilter struct {
// contains filtered or unexported fields
}
func (*BaseFilter) FieldName ¶
func (f *BaseFilter) FieldName() string
func (*BaseFilter) Operator ¶
func (f *BaseFilter) Operator() Operator
type BaseMetacommand ¶ added in v0.7.0
type BaseMetacommand struct { }
func (*BaseMetacommand) Type ¶ added in v0.7.0
func (m *BaseMetacommand) Type() string
type BaseOperation ¶ added in v0.7.0
type BaseOperation struct { }
func (*BaseOperation) Type ¶ added in v0.7.0
func (op *BaseOperation) Type() string
type Completer ¶ added in v0.5.4
type Completer struct {
// contains filtered or unexported fields
}
func NewCompleter ¶ added in v0.5.4
type CountOperation ¶ added in v0.8.0
type CountOperation struct { BaseOperation // contains filtered or unexported fields }
func NewCountOperation ¶ added in v0.8.0
func NewCountOperation(collection string, filters []Filter) *CountOperation
func (*CountOperation) Collection ¶ added in v0.8.0
func (op *CountOperation) Collection() string
func (*CountOperation) OperationType ¶ added in v0.8.0
func (op *CountOperation) OperationType() OperationType
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
func (*Executor) ExecuteCount ¶ added in v0.8.0
func (*Executor) ExecuteGet ¶ added in v0.3.0
func (exe *Executor) ExecuteGet(ctx context.Context, op *GetOperation) (*firestore.DocumentSnapshot, error)
func (*Executor) ExecuteListCollections ¶ added in v0.7.0
func (*Executor) ExecuteQuery ¶
func (exe *Executor) ExecuteQuery(ctx context.Context, op *QueryOperation) ([]*firestore.DocumentSnapshot, error)
type FloatFilter ¶
type FloatFilter struct { BaseFilter // contains filtered or unexported fields }
func NewFloatFilter ¶
func NewFloatFilter(field string, operator Operator, value float64) *FloatFilter
func (*FloatFilter) Value ¶
func (f *FloatFilter) Value() any
type GetOperation ¶ added in v0.3.0
type GetOperation struct { BaseOperation // contains filtered or unexported fields }
func NewGetOperation ¶ added in v0.3.0
func NewGetOperation(collection string, docId string) *GetOperation
func (*GetOperation) Collection ¶ added in v0.3.0
func (op *GetOperation) Collection() string
func (*GetOperation) DocId ¶ added in v0.3.0
func (op *GetOperation) DocId() string
func (*GetOperation) OperationType ¶ added in v0.3.0
func (op *GetOperation) OperationType() OperationType
type IntFilter ¶
type IntFilter struct { BaseFilter // contains filtered or unexported fields }
type Metacommand ¶ added in v0.7.0
type MetacommandListCollections ¶ added in v0.7.0
type MetacommandListCollections struct { BaseMetacommand // contains filtered or unexported fields }
func (*MetacommandListCollections) MetacommandType ¶ added in v0.7.0
func (m *MetacommandListCollections) MetacommandType() string
type MetacommandPager ¶ added in v0.7.0
type MetacommandPager struct { BaseMetacommand // contains filtered or unexported fields }
func (*MetacommandPager) MetacommandType ¶ added in v0.7.0
func (m *MetacommandPager) MetacommandType() string
type Operation ¶
type Operation interface { Type() string OperationType() OperationType Collection() string }
type OperationType ¶ added in v0.3.0
type OperationType string
const ( OPERATION_TYPE_QUERY OperationType = "QUERY" OPERATION_TYPE_GET OperationType = "GET" OPERATION_TYPE_COUNT OperationType = "COUNT" )
type Operator ¶ added in v0.2.0
type Operator string
const ( OPERATOR_EQ Operator = "==" OPERATOR_NOT_EQ Operator = "!=" OPERATOR_GT Operator = ">" OPERATOR_GTE Operator = ">=" OPERATOR_LT Operator = "<" OPERATOR_LTE Operator = "<=" OPERATOR_IN Operator = "in" OPERATOR_ARRAY_CONTAINS Operator = "array-contains" OPERATOR_ARRAY_CONTAINS_ANY Operator = "array-contains-any" )
type OutputMode ¶ added in v0.4.0
type OutputMode string
const ( OutputModeJSON OutputMode = "json" OutputModeTable OutputMode = "table" )
type ParseResult ¶ added in v0.7.0
type ParseResult interface {
Type() string
}
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func (*Parser) Parse ¶
func (p *Parser) Parse() (ParseResult, error)
type QueryOperation ¶
type QueryOperation struct { BaseOperation // contains filtered or unexported fields }
func NewQueryOperation ¶
func (*QueryOperation) Collection ¶
func (op *QueryOperation) Collection() string
func (*QueryOperation) OperationType ¶
func (op *QueryOperation) OperationType() OperationType
type Repl ¶ added in v0.4.0
type Repl struct {
// contains filtered or unexported fields
}
type StringFilter ¶
type StringFilter struct { BaseFilter // contains filtered or unexported fields }
func NewStringFilter ¶
func NewStringFilter(field string, operator Operator, value string) *StringFilter
func (*StringFilter) Value ¶
func (f *StringFilter) Value() any
Source Files ¶
Click to show internal directories.
Click to hide internal directories.