Documentation
¶
Index ¶
- type LegacySchemaReaderAdapter
- func (l *LegacySchemaReaderAdapter) ListAllCaveatDefinitions(ctx context.Context) ([]datastore.RevisionedCaveat, error)
- func (l *LegacySchemaReaderAdapter) ListAllSchemaDefinitions(ctx context.Context) (map[string]datastore.SchemaDefinition, error)
- func (l *LegacySchemaReaderAdapter) ListAllTypeDefinitions(ctx context.Context) ([]datastore.RevisionedTypeDefinition, error)
- func (l *LegacySchemaReaderAdapter) LookupCaveatDefByName(ctx context.Context, name string) (datastore.RevisionedCaveat, bool, error)
- func (l *LegacySchemaReaderAdapter) LookupCaveatDefinitionsByNames(ctx context.Context, names []string) (map[string]datastore.SchemaDefinition, error)
- func (l *LegacySchemaReaderAdapter) LookupSchemaDefinitionsByNames(ctx context.Context, names []string) (map[string]datastore.SchemaDefinition, error)
- func (l *LegacySchemaReaderAdapter) LookupTypeDefByName(ctx context.Context, name string) (datastore.RevisionedTypeDefinition, bool, error)
- func (l *LegacySchemaReaderAdapter) LookupTypeDefinitionsByNames(ctx context.Context, names []string) (map[string]datastore.SchemaDefinition, error)
- func (l *LegacySchemaReaderAdapter) SchemaText() (string, error)
- type LegacySchemaWriterAdapter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LegacySchemaReaderAdapter ¶
type LegacySchemaReaderAdapter struct {
// contains filtered or unexported fields
}
LegacySchemaReaderAdapter is a common implementation of SchemaReader that uses the legacy schema reader methods. This allows datastores to implement the new SchemaReader interface while still using the legacy methods internally during the transition period.
func NewLegacySchemaReaderAdapter ¶
func NewLegacySchemaReaderAdapter(legacyReader datastore.LegacySchemaReader) *LegacySchemaReaderAdapter
NewLegacySchemaReaderAdapter creates a new LegacySchemaReaderAdapter that wraps a LegacySchemaReader.
func (*LegacySchemaReaderAdapter) ListAllCaveatDefinitions ¶
func (l *LegacySchemaReaderAdapter) ListAllCaveatDefinitions(ctx context.Context) ([]datastore.RevisionedCaveat, error)
ListAllCaveatDefinitions lists all caveat definitions.
func (*LegacySchemaReaderAdapter) ListAllSchemaDefinitions ¶
func (l *LegacySchemaReaderAdapter) ListAllSchemaDefinitions(ctx context.Context) (map[string]datastore.SchemaDefinition, error)
ListAllSchemaDefinitions lists all type and caveat definitions.
func (*LegacySchemaReaderAdapter) ListAllTypeDefinitions ¶
func (l *LegacySchemaReaderAdapter) ListAllTypeDefinitions(ctx context.Context) ([]datastore.RevisionedTypeDefinition, error)
ListAllTypeDefinitions lists all type definitions (namespaces).
func (*LegacySchemaReaderAdapter) LookupCaveatDefByName ¶
func (l *LegacySchemaReaderAdapter) LookupCaveatDefByName(ctx context.Context, name string) (datastore.RevisionedCaveat, bool, error)
LookupCaveatDefByName looks up a caveat definition by name.
func (*LegacySchemaReaderAdapter) LookupCaveatDefinitionsByNames ¶
func (l *LegacySchemaReaderAdapter) LookupCaveatDefinitionsByNames(ctx context.Context, names []string) (map[string]datastore.SchemaDefinition, error)
LookupCaveatDefinitionsByNames looks up type definitions by name.
func (*LegacySchemaReaderAdapter) LookupSchemaDefinitionsByNames ¶
func (l *LegacySchemaReaderAdapter) LookupSchemaDefinitionsByNames(ctx context.Context, names []string) (map[string]datastore.SchemaDefinition, error)
LookupSchemaDefinitionsByNames looks up type and caveat definitions by name.
func (*LegacySchemaReaderAdapter) LookupTypeDefByName ¶
func (l *LegacySchemaReaderAdapter) LookupTypeDefByName(ctx context.Context, name string) (datastore.RevisionedTypeDefinition, bool, error)
LookupTypeDefByName looks up a type definition (namespace) by name.
func (*LegacySchemaReaderAdapter) LookupTypeDefinitionsByNames ¶
func (l *LegacySchemaReaderAdapter) LookupTypeDefinitionsByNames(ctx context.Context, names []string) (map[string]datastore.SchemaDefinition, error)
func (*LegacySchemaReaderAdapter) SchemaText ¶
func (l *LegacySchemaReaderAdapter) SchemaText() (string, error)
SchemaText returns the schema text at the current revision by reading all namespaces and caveats and generating the schema text from them.
type LegacySchemaWriterAdapter ¶
type LegacySchemaWriterAdapter struct {
// contains filtered or unexported fields
}
LegacySchemaWriterAdapter is a common implementation of SchemaWriter that uses the legacy schema writer methods. This allows datastores to implement the new SchemaWriter interface while still using the legacy methods internally during the transition period.
func NewLegacySchemaWriterAdapter ¶
func NewLegacySchemaWriterAdapter(legacyWriter datastore.LegacySchemaWriter, legacyReader datastore.LegacySchemaReader) *LegacySchemaWriterAdapter
NewLegacySchemaWriterAdapter creates a new LegacySchemaWriterAdapter that wraps a LegacySchemaWriter.
func (*LegacySchemaWriterAdapter) AddDefinitionsForTesting ¶
func (l *LegacySchemaWriterAdapter) AddDefinitionsForTesting(ctx context.Context, tb testing.TB, definitions ...datastore.SchemaDefinition) error
AddDefinitionsForTesting adds or overwrites the given schema definitions. This method is only for use in testing and requires a testing.TB instance to enforce this constraint.
func (*LegacySchemaWriterAdapter) WriteSchema ¶
func (l *LegacySchemaWriterAdapter) WriteSchema(ctx context.Context, definitions []datastore.SchemaDefinition, schemaString string, caveatTypeSet *types.TypeSet) error
WriteSchema writes the full set of schema definitions. The schema string is provided for future use but is currently ignored by implementations. The method validates that no definition names overlap, loads existing definitions, replaces changed ones, and deletes definitions no longer present.