transfer

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

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
	},
	STARTED: State{
		// contains filtered or unexported fields
	},
	SUSPENDED: State{
		// contains filtered or unexported fields
	},
	COMPLETED: State{
		// contains filtered or unexported fields
	},
	TERMINATED: State{
		// contains filtered or unexported fields
	},
}

Functions

func ExhaustiveStates

func ExhaustiveStates(f func(State))

func GenerateKey

func GenerateKey(id uuid.UUID, role constants.DataspaceRole) []byte

Types

type Direction

type Direction uint8
const (
	DirectionUnknown Direction = iota
	DirectionPull
	DirectionPush
)

type Request

type Request struct {
	// contains filtered or unexported fields
}

Request represents a transfer request and its state.

func FromBytes

func FromBytes(b []byte) (*Request, error)

func New

func New(
	consumerPID uuid.UUID,
	agreement *odrl.Agreement,
	format string,
	callback, self *url.URL,
	role constants.DataspaceRole,
	state State,
	publishInfo *providerv1.PublishInfo,
) *Request

func (*Request) GetAgreementID

func (tr *Request) GetAgreementID() uuid.UUID

func (*Request) GetCallback

func (tr *Request) GetCallback() *url.URL

func (*Request) GetConsumerPID

func (tr *Request) GetConsumerPID() uuid.UUID

func (*Request) GetFormat

func (tr *Request) GetFormat() string

func (*Request) GetProviderPID

func (tr *Request) GetProviderPID() uuid.UUID

Request getters.

func (*Request) GetPublishInfo

func (tr *Request) GetPublishInfo() *providerv1.PublishInfo

func (*Request) GetRole

func (tr *Request) GetRole() constants.DataspaceRole

func (*Request) GetSelf

func (tr *Request) GetSelf() *url.URL

func (*Request) GetState

func (tr *Request) GetState() State

func (*Request) GetTarget

func (tr *Request) GetTarget() string

func (*Request) GetTransferDirection

func (tr *Request) GetTransferDirection() Direction

func (*Request) GetTransferProcess

func (tr *Request) GetTransferProcess() shared.TransferProcess

func (*Request) GetTransferRequest

func (tr *Request) GetTransferRequest() *Request

func (*Request) Modified

func (tr *Request) Modified() bool

func (*Request) ReadOnly

func (tr *Request) ReadOnly() bool

Properties that decisions are based on.

func (*Request) SetProviderPID

func (tr *Request) SetProviderPID(id uuid.UUID)

func (*Request) SetPublishInfo

func (tr *Request) SetPublishInfo(pi *providerv1.PublishInfo)

Request setters, these will panic when the transfer is RO.

func (*Request) SetReadOnly

func (tr *Request) SetReadOnly()

Property setters.

func (*Request) SetState

func (tr *Request) SetState(state State) error

func (*Request) StorageKey

func (tr *Request) StorageKey() []byte

func (*Request) ToBytes

func (tr *Request) ToBytes() ([]byte, error)

type State

type State struct {
	// contains filtered or unexported fields
}

func ParseState

func ParseState(a any) (State, error)

func (*State) GobDecode

func (p *State) GobDecode(b []byte) error

func (State) GobEncode

func (p State) GobEncode() ([]byte, error)

func (State) IsValid

func (p State) IsValid() bool

func (State) MarshalJSON

func (p State) MarshalJSON() ([]byte, error)

func (*State) Scan

func (p *State) Scan(value any) error

func (State) String

func (i State) String() string

func (*State) UnmarshalJSON

func (p *State) UnmarshalJSON(b []byte) error

func (State) Value

func (p State) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL