Documentation ¶
Index ¶
- Constants
- func DropNewTables(tx *sql.Tx) error
- func FillIn(src interface{}, dest interface{}) int
- func GetLegacyTableName(networkID string, table string) string
- func LoadPlugins() error
- func Migrate(dbDriver string, dbSource string) error
- func MigrateGateways(sc *squirrel.StmtCache, builder sqorc.StatementBuilder, networkIDs []string) (map[string]map[string]MigratedGatewayMeta, error)
- func MigrateNetworks(sc *squirrel.StmtCache, builder sqorc.StatementBuilder) ([]string, error)
- func RunCustomPluginMigrations(sc *squirrel.StmtCache, builder sqorc.StatementBuilder) error
- func SetupTables(tx *sql.Tx, builder sqorc.StatementBuilder) error
- func Unmarshal(bt []byte, msg proto.Message) error
- func UnmarshalJSONPBProtosFromDatastore(sc *squirrel.StmtCache, builder sqorc.StatementBuilder, networkID string, ...) (map[string]proto.Message, error)
- func UnmarshalProtoMessagesFromDatastore(sc *squirrel.StmtCache, builder sqorc.StatementBuilder, networkID string, ...) (map[string]proto.Message, error)
- type ConfigMigrator
- type ConfiguratorMigrationPlugin
- type MigratedGatewayMeta
Constants ¶
const ( NetworksTable = "cfg_networks" NetworkConfigTable = "cfg_network_configs" EntityTable = "cfg_entities" EntityAssocTable = "cfg_assocs" EntityAclTable = "cfg_acls" NwIDCol = "id" NwNameCol = "name" NwDescCol = "description" NwVerCol = "version" NwcIDCol = "network_id" NwcTypeCol = "type" NwcValCol = "value" EntPkCol = "pk" EntNidCol = "network_id" EntTypeCol = "type" EntKeyCol = "\"key\"" EntGidCol = "graph_id" EntNameCol = "name" EntDescCol = "description" EntPidCol = "physical_id" EntConfCol = "config" EntVerCol = "version" AFrCol = "from_pk" AToCol = "to_pk" AclIdCol = "id" AclEntCol = "entity_pk" AclScopeCol = "scope" AclPermCol = "permission" AclTypeCol = "type" AclIdFilterCol = "id_filter" AclVerCol = "version" InternalNetworkID = "network_magma_internal" )
duplicated constants from configurator
const ( BlobNidCol = "network_id" BlobTypeCol = "type" BlobKeyCol = "\"key\"" BlobValCol = "value" BlobVerCol = "version" )
duplicated constants from blobstore
const ( AgRecordTableName = "gatewayRecords" HwIdTableName = "hwIds" NetworksTableName = "networks" GatewaysTableName = "gateways" )
duplicated constants from magmad
const ( ConfigTable = "configurations" ConfigTypeCol = "type" ConfigKeyCol = "\"key\"" ConfigValCol = "value" )
duplicated constants from config
const ( DatastoreKeyCol = "\"key\"" DatastoreValCol = "value" DatastoreGenCol = "generation_number" DatastoreDeletedCol = "deleted" )
const MAGMA_ALT_NAME_TAG string = "magma_alt_name"
Go Struct tag to specify an alternative name for field name matching
const (
NetworkFeaturesConfig = "orc8r_features"
)
const (
StateServiceTable = "states"
)
Variables ¶
This section is empty.
Functions ¶
func DropNewTables ¶
func FillIn ¶
func FillIn(src interface{}, dest interface{}) int
FillIn assigns matching field values of src to dest A fields from src & dest are considered "matching" if they have identical names & Types FillIn will recursively inspect structures to find matching fields and return number of successfully set fields
func GetLegacyTableName ¶
func LoadPlugins ¶
func LoadPlugins() error
func MigrateGateways ¶
func MigrateGateways(sc *squirrel.StmtCache, builder sqorc.StatementBuilder, networkIDs []string) (map[string]map[string]MigratedGatewayMeta, error)
func MigrateNetworks ¶
func RunCustomPluginMigrations ¶
func RunCustomPluginMigrations(sc *squirrel.StmtCache, builder sqorc.StatementBuilder) error
func SetupTables ¶
func SetupTables(tx *sql.Tx, builder sqorc.StatementBuilder) error
Types ¶
type ConfigMigrator ¶
ConfigMigrator is responsible for deserializing a legacy config and reserializing it into a configurator config
type ConfiguratorMigrationPlugin ¶
type ConfiguratorMigrationPlugin interface { GetConfigMigrators() []ConfigMigrator RunCustomMigrations( sc *squirrel.StmtCache, builder sqorc.StatementBuilder, migratedGatewayMetasByNetwork map[string]map[string]MigratedGatewayMeta, ) error }
ConfiguratorMigrationPlugin defines the surface area for modules to integrate into the configurator data migration.
type MigratedGatewayMeta ¶
type MigratedGatewayMeta struct {
Pk, GraphID string
}
returns gw ids and map between gw id and graph id