Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
 - Variables
 - 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) RouterInfo() HttpRouterInfo
 - func (o *ConfigMock) SchemaUpdateInterval() time.Duration
 - func (o *ConfigMock) UseUserOrRoleAuth() bool
 
- type HttpRouterInfo
 - type KeyspaceNamingInfo
 - type KeyspaceNamingInfoMock
 - type NamingConvention
 - type NamingConventionFn
 - type SchemaOperations
 - type UrlParamGetter
 - type UrlPattern
 
Constants ¶
      View Source
      
  
    const ( DefaultPageSize = 100 DefaultConsistencyLevel = gocql.LocalQuorum DefaultSerialConsistencyLevel = gocql.Serial )
      View Source
      
  
const AllSchemaOperations = TableCreate | TableDrop | TableAlterAdd | TableAlterDrop | KeyspaceCreate | KeyspaceDrop
    Variables ¶
      View Source
      
  
var SystemKeyspaces = []string{
	"system", "system_auth", "system_distributed", "system_schema", "system_traces", "system_views", "system_virtual_schema",
	"dse_insights", "dse_insights_local", "dse_leases", "dse_perf", "dse_security", "dse_system", "dse_system_local",
	"solr_admin", "OpsCenter", "dse_analytics", "system_backups", "dsefs",
}
    Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config interface {
	ExcludedKeyspaces() []string
	SchemaUpdateInterval() time.Duration
	Naming() NamingConventionFn
	UseUserOrRoleAuth() bool
	Logger() log.Logger
	RouterInfo() HttpRouterInfo
}
    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) RouterInfo ¶
func (o *ConfigMock) RouterInfo() HttpRouterInfo
func (*ConfigMock) SchemaUpdateInterval ¶
func (o *ConfigMock) SchemaUpdateInterval() time.Duration
func (*ConfigMock) UseUserOrRoleAuth ¶
func (o *ConfigMock) UseUserOrRoleAuth() bool
type HttpRouterInfo ¶
type HttpRouterInfo interface {
	UrlPattern() UrlPattern
	UrlParams() UrlParamGetter
}
    func DefaultRouterInfo ¶
func DefaultRouterInfo() HttpRouterInfo
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
UrlPattern determines how parameters are represented in the url For example: "/graphql/:param1" (colon, default) or "/graphql/{param1}" (brackets)
const ( UrlPatternColon UrlPattern = iota UrlPatternBrackets )
func (UrlPattern) UrlPathFormat ¶
func (p UrlPattern) UrlPathFormat(format string, parameterNames ...string) string
 Click to show internal directories. 
   Click to hide internal directories.