 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Overview ¶
Package diff contains code for things that can be diffed (e.g. namespaces and caveats).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiffableSchema ¶
type DiffableSchema struct {
	// ObjectDefinitions holds the object definitions in the schema.
	ObjectDefinitions []*core.NamespaceDefinition
	// CaveatDefinitions holds the caveat definitions in the schema.
	CaveatDefinitions []*core.CaveatDefinition
}
    DiffableSchema is a schema that can be diffed.
func NewDiffableSchemaFromCompiledSchema ¶
func NewDiffableSchemaFromCompiledSchema(compiled *compiler.CompiledSchema) DiffableSchema
NewDiffableSchemaFromCompiledSchema creates a new DiffableSchema from a CompiledSchema.
func (*DiffableSchema) GetCaveat ¶
func (ds *DiffableSchema) GetCaveat(caveatName string) (*core.CaveatDefinition, bool)
func (*DiffableSchema) GetNamespace ¶
func (ds *DiffableSchema) GetNamespace(namespaceName string) (*core.NamespaceDefinition, bool)
func (*DiffableSchema) GetRelation ¶
type SchemaDiff ¶
type SchemaDiff struct {
	// AddedNamespaces are the namespaces that were added.
	AddedNamespaces []string
	// RemovedNamespaces are the namespaces that were removed.
	RemovedNamespaces []string
	// AddedCaveats are the caveats that were added.
	AddedCaveats []string
	// RemovedCaveats are the caveats that were removed.
	RemovedCaveats []string
	// ChangedNamespaces are the namespaces that were changed.
	ChangedNamespaces map[string]namespace.Diff
	// ChangedCaveats are the caveats that were changed.
	ChangedCaveats map[string]caveats.Diff
}
    SchemaDiff holds the diff between two schemas.
func DiffSchemas ¶
func DiffSchemas(existing DiffableSchema, comparison DiffableSchema, caveatTypeSet *caveattypes.TypeSet) (*SchemaDiff, error)
DiffSchemas compares two schemas and returns the diff.
 Click to show internal directories. 
   Click to hide internal directories.