Skip to content
Snippets Groups Projects
change.go 777 B
Newer Older
  • Learn to ignore specific revisions
  • package change
    
    
    Manuel Kieweg's avatar
    Manuel Kieweg committed
    import (
    
    Manuel Kieweg's avatar
    Manuel Kieweg committed
    	ppb "code.fbi.h-da.de/danet/api/go/gosdn/pnd"
    
    Manuel Kieweg's avatar
    Manuel Kieweg committed
    	"github.com/google/uuid"
    
    	"github.com/openconfig/ygot/ygot"
    
    Manuel Kieweg's avatar
    Manuel Kieweg committed
    )
    
    
    // Change is an intended change to an OND. It is unique and immutable.
    // It has a cuid, a timestamp, and holds both the previous and the new
    // state. It keeps track if the state is committed and confirmed. A callback
    // exists to acess the proper transport for the changed OND
    type Change interface {
    	ID() uuid.UUID
    	Commit() error
    	Confirm() error
    
    Manuel Kieweg's avatar
    Manuel Kieweg committed
    	State() ppb.Change_State
    
    	Age() time.Duration
    
    
    // Payload contains two ygot.GoStructs, the first represents the original state
    // before the change was applied and the second repesents the modified state.
    type Payload struct {
    	Original ygot.GoStruct
    	Modified ygot.GoStruct
    }