Documentation ¶
Index ¶
- func ParseCQLFile(filePath string) ([]string, error)
- func RunTool(args []string) error
- func SetupSchema(config *SetupSchemaConfig) error
- type BaseConfig
- type CQLClient
- type ConfigError
- type CreateKeyspaceConfig
- type SetupSchemaConfig
- type SetupSchemaTask
- type UpdateSchemaConfig
- type UpdateSchemaTask
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseCQLFile ¶
ParseCQLFile takes a cql file path as input and returns an array of cql statements on success.
func SetupSchema ¶
func SetupSchema(config *SetupSchemaConfig) error
SetupSchema setups the cassandra schema
Types ¶
type BaseConfig ¶
type BaseConfig struct { CassHosts string CassPort int CassUser string CassPassword string CassKeyspace string }
BaseConfig is the common config for all of the tasks that work with cassandra
type CQLClient ¶
type CQLClient interface { // Exec executes a cql statement Exec(stmt string) error // ListTables lists the table names in a keyspace ListTables() ([]string, error) // ListTypes lists the user defined types in a keyspace ListTypes() ([]string, error) // CreateKeyspace creates a keyspace, if it doesn't exist // it uses SimpleStrategy by default CreateKeyspace(name string, replicas int) error // DropTable drops the given table DropTable(name string) error // DropType drops a user defined type from keyspace DropType(name string) error // DropKeyspace drops a keyspace DropKeyspace(keyspace string) error // CreateSchemaVersionTables sets up the schema version tables CreateSchemaVersionTables() error // ReadSchemaVersion returns the current schema version for the keyspace ReadSchemaVersion() (string, error) // UpdateSchemaVersion updates the schema version for the keyspace UpdateSchemaVersion(newVersion string, minCompatibleVersion string) error // WriteSchemaUpdateLog adds an entry to the schema update history table WriteSchemaUpdateLog(oldVersion string, newVersion string, manifestMD5 string, desc string) error // Close gracefully closes the client object Close() }
CQLClient is the interface for implementations that provide a way to talk to cassandra through CQL
type ConfigError ¶
type ConfigError struct {
// contains filtered or unexported fields
}
ConfigError is an error type that represents a problem with the config
func (*ConfigError) Error ¶
func (e *ConfigError) Error() string
type CreateKeyspaceConfig ¶
type CreateKeyspaceConfig struct { BaseConfig ReplicationFactor int }
CreateKeyspaceConfig holds the config params needed to create a cassandra keyspace
type SetupSchemaConfig ¶
type SetupSchemaConfig struct { BaseConfig SchemaFilePath string InitialVersion string Overwrite bool // overwrite previous data DisableVersioning bool // do not use schema versioning }
SetupSchemaConfig holds the config params need by the SetupSchemaTask
type SetupSchemaTask ¶
type SetupSchemaTask struct {
// contains filtered or unexported fields
}
SetupSchemaTask represents a task that sets up cassandra schema on a specified keyspace
type UpdateSchemaConfig ¶
type UpdateSchemaConfig struct { BaseConfig TargetVersion string SchemaDir string IsDryRun bool }
UpdateSchemaConfig holds the config params for executing a UpdateSchemaTask
type UpdateSchemaTask ¶
type UpdateSchemaTask struct {
// contains filtered or unexported fields
}
UpdateSchemaTask represents a task that executes a cassandra schema upgrade
func NewUpdateSchemaTask ¶
func NewUpdateSchemaTask(config *UpdateSchemaConfig) (*UpdateSchemaTask, error)
NewUpdateSchemaTask returns a new instance of UpdateSchemaTask