Documentation
¶
Index ¶
- Constants
- type Config
- type ConfigMock
- func (o *ConfigMock) Default() *ConfigMock
- func (o *ConfigMock) ExcludedKeyspaces() []string
- func (o *ConfigMock) Logger() log.Logger
- func (o *ConfigMock) Naming() NamingConventionFn
- func (o *ConfigMock) SchemaUpdateInterval() time.Duration
- func (o *ConfigMock) UrlPattern() UrlPattern
- func (o *ConfigMock) UseUserOrRoleAuth() bool
- type KeyspaceNamingInfo
- type KeyspaceNamingInfoMock
- type NamingConvention
- type NamingConventionFn
- type SchemaOperations
- type UrlPattern
Constants ¶
View Source
const AllSchemaOperations = TableCreate | TableDrop | TableAlterAdd | TableAlterDrop | KeyspaceCreate | KeyspaceDrop
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config interface {
ExcludedKeyspaces() []string
SchemaUpdateInterval() time.Duration
Naming() NamingConventionFn
UseUserOrRoleAuth() bool
Logger() log.Logger
UrlPattern() UrlPattern
}
type ConfigMock ¶
func NewConfigMock ¶
func NewConfigMock() *ConfigMock
func (*ConfigMock) Default ¶
func (o *ConfigMock) Default() *ConfigMock
func (*ConfigMock) ExcludedKeyspaces ¶
func (o *ConfigMock) ExcludedKeyspaces() []string
func (*ConfigMock) Logger ¶
func (o *ConfigMock) Logger() log.Logger
func (*ConfigMock) Naming ¶
func (o *ConfigMock) Naming() NamingConventionFn
func (*ConfigMock) SchemaUpdateInterval ¶
func (o *ConfigMock) SchemaUpdateInterval() time.Duration
func (*ConfigMock) UrlPattern ¶
func (o *ConfigMock) UrlPattern() UrlPattern
func (*ConfigMock) UseUserOrRoleAuth ¶
func (o *ConfigMock) UseUserOrRoleAuth() bool
type KeyspaceNamingInfo ¶
type KeyspaceNamingInfoMock ¶
func NewKeyspaceNamingInfoMock ¶
func NewKeyspaceNamingInfoMock() *KeyspaceNamingInfoMock
func (*KeyspaceNamingInfoMock) Tables ¶
func (o *KeyspaceNamingInfoMock) Tables() map[string][]string
type NamingConvention ¶
type NamingConvention interface {
// ToCQLColumn converts a GraphQL/REST name to a CQL column name.
ToCQLColumn(tableName string, fieldName string) string
// ToCQLColumn converts a GraphQL/REST name to a CQL table name.
ToCQLTable(name string) string
// ToGraphQLField converts a CQL name (typically a column name) to a GraphQL field name.
ToGraphQLField(tableName string, columnName string) string
// ToGraphQLOperation converts a CQL name (typically a table name) to a GraphQL operation name.
ToGraphQLOperation(prefix string, name string) string
// ToGraphQLType converts a CQL name (typically a table name) to a GraphQL type name.
ToGraphQLType(name string) string
// ToGraphQLType converts a CQL table name to a GraphQL while also checking that the type name doesn't collide
// with types generated by a table name.
// For example: calls for ToGraphQLTypeUnique("tbl_one", "input") will return
// - "TblOneInput" when there isn't a table that generates the same name
// - "TblOneInput2" when there is a table that generates the same name
ToGraphQLTypeUnique(name string, suffix string) string
}
func NewDefaultNaming ¶
func NewDefaultNaming(info KeyspaceNamingInfo) NamingConvention
type NamingConventionFn ¶
type NamingConventionFn func(KeyspaceNamingInfo) NamingConvention
type SchemaOperations ¶
type SchemaOperations int
const ( TableCreate SchemaOperations = 1 << iota TableDrop TableAlterAdd TableAlterDrop KeyspaceCreate KeyspaceDrop )
func Ops ¶
func Ops(ops ...string) (SchemaOperations, error)
func (*SchemaOperations) Add ¶
func (o *SchemaOperations) Add(ops ...string) error
func (*SchemaOperations) Clear ¶
func (o *SchemaOperations) Clear(ops SchemaOperations)
func (SchemaOperations) IsSupported ¶
func (o SchemaOperations) IsSupported(ops SchemaOperations) bool
func (*SchemaOperations) Set ¶
func (o *SchemaOperations) Set(ops SchemaOperations)
type UrlPattern ¶
type UrlPattern int
const ( UrlPatternColon UrlPattern = iota UrlPatternBrackets )
Click to show internal directories.
Click to hide internal directories.