Documentation ¶
Overview ¶
package kubernetes implements a data source (backend) to allow dataux to use sql against kubernetes rest/grpc api's
Index ¶
- Constants
- Variables
- type Mutator
- type Object
- type ObjectIterator
- type ResultReader
- type Source
- func (m *Source) Close() error
- func (m *Source) DataSource() schema.Source
- func (m *Source) Init()
- func (m *Source) Open(tableName string) (schema.Conn, error)
- func (m *Source) Setup(ss *schema.SchemaSource) error
- func (m *Source) Table(table string) (*schema.Table, error)
- func (m *Source) Tables() []string
- type SqlToKube
- func (m *SqlToKube) CreateMutator(pc interface{}) (schema.ConnMutator, error)
- func (m *SqlToKube) Delete(key driver.Value) (int, error)
- func (m *SqlToKube) DeleteExpression(p interface{}, where expr.Node) (int, error)
- func (m *SqlToKube) Put(ctx context.Context, key schema.Key, val interface{}) (schema.Key, error)
- func (m *SqlToKube) PutMulti(ctx context.Context, keys []schema.Key, src interface{}) ([]schema.Key, error)
- func (m *SqlToKube) WalkExecSource(p *plan.Source) (exec.Task, error)
- func (m *SqlToKube) WalkSourceSelect(planner plan.Planner, p *plan.Source) (plan.Task, error)
Constants ¶
const (
DataSourceLabel = "kubernetes"
)
Variables ¶
var ( // Default page size limit DefaultLimit = 5000 Timeout = 10 * time.Second )
var (
ErrNoSchema = fmt.Errorf("No schema or configuration exists")
)
Functions ¶
This section is empty.
Types ¶
type Mutator ¶
type Mutator struct {
// contains filtered or unexported fields
}
Mutator a mutator connection
type ObjectIterator ¶
type ObjectIterator struct {
// contains filtered or unexported fields
}
An ObjectIterator is an iterator over Object which is a generic Object type representing a kube object.
func Objects ¶
func Objects(ctx context.Context, kind string, q *SqlToKube) *ObjectIterator
Objects returns an iterator over the objects in the bucket that match the Query q. If q is nil, no filtering is done.
func (*ObjectIterator) Next ¶
func (it *ObjectIterator) Next() (*Object, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns iterator.Done, all subsequent calls will return iterator.Done.
func (*ObjectIterator) PageInfo ¶
func (it *ObjectIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ResultReader ¶
ResultReader implements result paging, reading of the json/grpc api responses from kube
func NewResultReader ¶
func NewResultReader(req *SqlToKube) *ResultReader
func (*ResultReader) Close ¶
func (m *ResultReader) Close() error
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source is a Kubernetes datasource, this provides Reads, Insert, Update, Delete - singleton shared instance - creates clients to kube api (clients perform queries) - provides schema info about the apis
func (*Source) DataSource ¶
type SqlToKube ¶
SqlToKube Convert a Sql Query to a kubernetes api call - responsible for pushing down as much logic to kube api's as possible - dialect translator
func NewSqlToKube ¶
NewSqlToKube create a SQL ast -> Kubernetes Translater
func (*SqlToKube) CreateMutator ¶
func (m *SqlToKube) CreateMutator(pc interface{}) (schema.ConnMutator, error)
CreateMutator part of Mutator interface to allow data sources create a stateful
mutation context for update/delete operations.
func (*SqlToKube) DeleteExpression ¶
DeleteExpression - delete by expression (where clause)
- For where columns contained in Partition Keys we can push to cassandra
- for others we might have to do a select -> delete
func (*SqlToKube) WalkExecSource ¶
WalkExecSource an interface of executor that allows this source to create its own execution Task so that it can push down as much as it can to kubernetes api.