Documentation
¶
Overview ¶
Package contract contains the Negotiation type and all related code.
Index ¶
- Variables
- func ExhaustiveStates(f func(State))
- func GenerateStorageKey(id uuid.UUID, role constants.DataspaceRole) []byte
- type Negotiation
- func (cn *Negotiation) GetAgreement() *odrl.Agreement
- func (cn *Negotiation) GetCallback() *url.URL
- func (cn *Negotiation) GetConsumerPID() uuid.UUID
- func (cn *Negotiation) GetContract() *Negotiation
- func (cn *Negotiation) GetContractNegotiation() shared.ContractNegotiation
- func (cn *Negotiation) GetOffer() odrl.Offer
- func (cn *Negotiation) GetProviderPID() uuid.UUID
- func (cn *Negotiation) GetRole() constants.DataspaceRole
- func (cn *Negotiation) GetSelf() *url.URL
- func (cn *Negotiation) GetState() State
- func (cn *Negotiation) Initial() bool
- func (cn *Negotiation) Modified() bool
- func (cn *Negotiation) ReadOnly() bool
- func (cn *Negotiation) SetAgreement(a *odrl.Agreement)
- func (cn *Negotiation) SetCallback(u string) error
- func (cn *Negotiation) SetConsumerPID(u uuid.UUID)
- func (cn *Negotiation) SetInitial()
- func (cn *Negotiation) SetProviderPID(u uuid.UUID)
- func (cn *Negotiation) SetReadOnly()
- func (cn *Negotiation) SetState(state State) error
- func (cn *Negotiation) StorageKey() []byte
- func (cn *Negotiation) ToBytes() ([]byte, error)
- func (cn *Negotiation) UnsetInitial()
- type State
- func (p *State) GobDecode(b []byte) error
- func (p State) GobEncode() ([]byte, error)
- func (p State) IsValid() bool
- func (p State) MarshalJSON() ([]byte, error)
- func (p *State) Scan(value any) error
- func (i State) String() string
- func (p *State) UnmarshalJSON(b []byte) error
- func (p State) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var States = statesContainer{ INITIAL: State{ // contains filtered or unexported fields }, REQUESTED: State{ // contains filtered or unexported fields }, OFFERED: State{ // contains filtered or unexported fields }, AGREED: State{ // contains filtered or unexported fields }, ACCEPTED: State{ // contains filtered or unexported fields }, VERIFIED: State{ // contains filtered or unexported fields }, FINALIZED: State{ // contains filtered or unexported fields }, TERMINATED: State{ // contains filtered or unexported fields }, }
Functions ¶
func ExhaustiveStates ¶
func ExhaustiveStates(f func(State))
func GenerateStorageKey ¶
func GenerateStorageKey(id uuid.UUID, role constants.DataspaceRole) []byte
GenerateStorageKey generates a key for a contract negotiation.
Types ¶
type Negotiation ¶
type Negotiation struct {
// contains filtered or unexported fields
}
Negotiation represents a contract negotiation.
func FromBytes ¶
func FromBytes(b []byte) (*Negotiation, error)
func New ¶
func New( providerPID, consumerPID uuid.UUID, state State, offer odrl.Offer, callback, self *url.URL, role constants.DataspaceRole, ) *Negotiation
func (*Negotiation) GetAgreement ¶
func (cn *Negotiation) GetAgreement() *odrl.Agreement
func (*Negotiation) GetCallback ¶
func (cn *Negotiation) GetCallback() *url.URL
func (*Negotiation) GetConsumerPID ¶
func (cn *Negotiation) GetConsumerPID() uuid.UUID
func (*Negotiation) GetContract ¶
func (cn *Negotiation) GetContract() *Negotiation
func (*Negotiation) GetContractNegotiation ¶
func (cn *Negotiation) GetContractNegotiation() shared.ContractNegotiation
GetContractNegotiation returns a ContractNegotiation message.
func (*Negotiation) GetOffer ¶
func (cn *Negotiation) GetOffer() odrl.Offer
func (*Negotiation) GetProviderPID ¶
func (cn *Negotiation) GetProviderPID() uuid.UUID
Negotiation getters.
func (*Negotiation) GetRole ¶
func (cn *Negotiation) GetRole() constants.DataspaceRole
func (*Negotiation) GetSelf ¶
func (cn *Negotiation) GetSelf() *url.URL
func (*Negotiation) GetState ¶
func (cn *Negotiation) GetState() State
func (*Negotiation) Initial ¶
func (cn *Negotiation) Initial() bool
func (*Negotiation) Modified ¶
func (cn *Negotiation) Modified() bool
func (*Negotiation) ReadOnly ¶
func (cn *Negotiation) ReadOnly() bool
Properties that decisions are based on.
func (*Negotiation) SetAgreement ¶
func (cn *Negotiation) SetAgreement(a *odrl.Agreement)
func (*Negotiation) SetCallback ¶
func (cn *Negotiation) SetCallback(u string) error
SetCallback sets the remote callback root.
func (*Negotiation) SetConsumerPID ¶
func (cn *Negotiation) SetConsumerPID(u uuid.UUID)
func (*Negotiation) SetInitial ¶
func (cn *Negotiation) SetInitial()
func (*Negotiation) SetProviderPID ¶
func (cn *Negotiation) SetProviderPID(u uuid.UUID)
Negotiation setters, these will panic when the negotiation is RO.
func (*Negotiation) SetState ¶
func (cn *Negotiation) SetState(state State) error
func (*Negotiation) StorageKey ¶
func (cn *Negotiation) StorageKey() []byte
func (*Negotiation) ToBytes ¶
func (cn *Negotiation) ToBytes() ([]byte, error)
ToBytes returns a binary representation of the negotiation, one that is compatible with the FromBytes function.
func (*Negotiation) UnsetInitial ¶
func (cn *Negotiation) UnsetInitial()
type State ¶
type State struct {
// contains filtered or unexported fields
}
func ParseState ¶
func (State) MarshalJSON ¶
func (*State) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.