sobject

package
v0.51.2 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxErrorDetailsSize is the maximum size in bytes for error details
	MaxErrorDetailsSize = 4096

	// MaxBlockRefSize is the maximum size in bytes for block references
	MaxBlockRefSize = 256

	// MaxInnerDataSize is the maximum size in bytes for inner data
	MaxInnerDataSize = 1024 * 1024 // 1 MB

	// MaxSignatureSize is the maximum size in bytes for signatures
	MaxSignatureSize = 512

	// MaxParticipants is the maximum number of participants in a shared object
	MaxParticipants = 100

	// MaxOperations is the maximum number of pending operations
	MaxOperations = 1000

	// MaxOperationRejections is the maximum number of operation rejections
	MaxOperationRejections = 1000

	// MaxValidatorSignatures is the maximum number of validator signatures
	MaxValidatorSignatures = 100

	// MaxStateDataSize is the maximum size in bytes for state data
	MaxStateDataSize = 10 * 1024 * 1024 // 10 MB
)
View Source
const (
	// MaxBodyTypeLength is the maximum length of a body_type string.
	MaxBodyTypeLength = 1024
	// MaxBodyMetaLength is the maximum length of body_meta bytes.
	MaxBodyMetaLength = 4096
)
View Source
const OwnerTypeAccount = "account"

OwnerTypeAccount is the owner type for account-owned shared objects.

View Source
const OwnerTypeOrganization = "organization"

OwnerTypeOrganization is the owner type for org-owned shared objects.

Variables

View Source
var (
	// ErrEmptySharedObjectID is returned if the shared object id was empty.
	ErrEmptySharedObjectID = errors.New("shared object id cannot be empty")

	// ErrInvalidSharedObjectID is returned if the shared object id was invalid.
	ErrInvalidSharedObjectID = errors.New("invalid shared object id")

	// ErrSharedObjectExists is returned if the shared object already exists.
	ErrSharedObjectExists = errors.New("shared object with that id already exists")

	// ErrSharedObjectNotFound is returned if the sobject was not found.
	ErrSharedObjectNotFound = errors.New("shared object not found")

	// ErrInvalidSOParticipantRole is returned if the shared object participant role is invalid.
	ErrInvalidSOParticipantRole = errors.New("invalid shared object participant role")

	// ErrEmptyParticipants is returned if no participants are specified in the SharedObjectConfig.
	ErrEmptyParticipants = errors.New("empty shared object participants list")

	// ErrEmptyBodyType is returned if the sobject body type was empty.
	ErrEmptyBodyType = errors.New("empty shared object body type")

	// ErrEmptyInnerData is returned if the inner data was empty.
	ErrEmptyInnerData = errors.New("empty inner data")

	// ErrInvalidSeqno is returned if the root seqno was unexpected.
	ErrInvalidSeqno = errors.New("invalid shared object root seqno")

	// ErrInvalidNonce is returned if the op nonce was unexpected.
	ErrInvalidNonce = errors.New("invalid shared object op nonce")

	// ErrEmptyValidatorSignatures is returned if there are no validator signatures.
	ErrEmptyValidatorSignatures = errors.New("at least one validator signature required")

	// ErrCannotDecode is returned if our local peer cannot decode the inner data (no valid grant).
	ErrCannotDecode = errors.New("access denied: no valid grant for our peer")

	// ErrNotParticipant is returned if the peer is not a participant in the shared object.
	ErrNotParticipant = errors.New("access denied: peer is not a participant")

	// ErrEmptyTransformConfig is returned if the transform config was empty.
	ErrEmptyTransformConfig = errors.New("transform config is required")

	// ErrMaxSizeExceeded is returned if a size limit is exceeded.
	ErrMaxSizeExceeded = errors.New("maximum size exceeded")

	// ErrMaxCountExceeded is returned if a count limit is exceeded.
	ErrMaxCountExceeded = errors.New("maximum count exceeded")

	// ErrInvalidLocalOpID is returned if the local op id is invalid.
	ErrInvalidLocalOpID = ulid.ErrInvalidULID

	// ErrRejectedOp is returned if the op was rejected.
	ErrRejectedOp = errors.New("rejected op")

	// ErrInvalidValidator is returned if the required validator peer is not in the set of signatures.
	ErrInvalidValidator = errors.New("required validator peer not in set of signatures")

	// ErrInvalidMeta is returned if the metadata is invalid.
	ErrInvalidMeta = errors.New("sobject: meta: invalid shared object metadata")

	// ErrSharedObjectRecoveryCredentialRequired is returned if recovery needs entity credentials.
	ErrSharedObjectRecoveryCredentialRequired = errors.New("shared object recovery requires entity credentials")

	// ErrSharedObjectRecoveryEntityMismatch is returned if recovery material does not match the current entity.
	ErrSharedObjectRecoveryEntityMismatch = errors.New("shared object recovery entity mismatch")
)
View Source
var (
	SharedObjectHealthStatus_name = map[int32]string{
		0: "SHARED_OBJECT_HEALTH_STATUS_UNKNOWN",
		1: "SHARED_OBJECT_HEALTH_STATUS_LOADING",
		2: "SHARED_OBJECT_HEALTH_STATUS_READY",
		3: "SHARED_OBJECT_HEALTH_STATUS_DEGRADED",
		4: "SHARED_OBJECT_HEALTH_STATUS_CLOSED",
	}
	SharedObjectHealthStatus_value = map[string]int32{
		"SHARED_OBJECT_HEALTH_STATUS_UNKNOWN":  0,
		"SHARED_OBJECT_HEALTH_STATUS_LOADING":  1,
		"SHARED_OBJECT_HEALTH_STATUS_READY":    2,
		"SHARED_OBJECT_HEALTH_STATUS_DEGRADED": 3,
		"SHARED_OBJECT_HEALTH_STATUS_CLOSED":   4,
	}
)

Enum value maps for SharedObjectHealthStatus.

View Source
var (
	SharedObjectHealthLayer_name = map[int32]string{
		0: "SHARED_OBJECT_HEALTH_LAYER_UNKNOWN",
		1: "SHARED_OBJECT_HEALTH_LAYER_SHARED_OBJECT",
		2: "SHARED_OBJECT_HEALTH_LAYER_BODY",
	}
	SharedObjectHealthLayer_value = map[string]int32{
		"SHARED_OBJECT_HEALTH_LAYER_UNKNOWN":       0,
		"SHARED_OBJECT_HEALTH_LAYER_SHARED_OBJECT": 1,
		"SHARED_OBJECT_HEALTH_LAYER_BODY":          2,
	}
)

Enum value maps for SharedObjectHealthLayer.

View Source
var (
	SharedObjectHealthCommonReason_name = map[int32]string{
		0: "SHARED_OBJECT_HEALTH_COMMON_REASON_UNKNOWN",
		1: "SHARED_OBJECT_HEALTH_COMMON_REASON_NOT_FOUND",
		2: "SHARED_OBJECT_HEALTH_COMMON_REASON_ACCESS_REVOKED",
		3: "SHARED_OBJECT_HEALTH_COMMON_REASON_INITIAL_STATE_REJECTED",
		4: "SHARED_OBJECT_HEALTH_COMMON_REASON_BLOCK_NOT_FOUND",
		5: "SHARED_OBJECT_HEALTH_COMMON_REASON_TRANSFORM_CONFIG_DECODE_FAILED",
		6: "SHARED_OBJECT_HEALTH_COMMON_REASON_BODY_CONFIG_DECODE_FAILED",
	}
	SharedObjectHealthCommonReason_value = map[string]int32{
		"SHARED_OBJECT_HEALTH_COMMON_REASON_UNKNOWN":                        0,
		"SHARED_OBJECT_HEALTH_COMMON_REASON_NOT_FOUND":                      1,
		"SHARED_OBJECT_HEALTH_COMMON_REASON_ACCESS_REVOKED":                 2,
		"SHARED_OBJECT_HEALTH_COMMON_REASON_INITIAL_STATE_REJECTED":         3,
		"SHARED_OBJECT_HEALTH_COMMON_REASON_BLOCK_NOT_FOUND":                4,
		"SHARED_OBJECT_HEALTH_COMMON_REASON_TRANSFORM_CONFIG_DECODE_FAILED": 5,
		"SHARED_OBJECT_HEALTH_COMMON_REASON_BODY_CONFIG_DECODE_FAILED":      6,
	}
)

Enum value maps for SharedObjectHealthCommonReason.

View Source
var (
	SharedObjectHealthRemediationHint_name = map[int32]string{
		0: "SHARED_OBJECT_HEALTH_REMEDIATION_HINT_UNKNOWN",
		1: "SHARED_OBJECT_HEALTH_REMEDIATION_HINT_NONE",
		2: "SHARED_OBJECT_HEALTH_REMEDIATION_HINT_RETRY",
		3: "SHARED_OBJECT_HEALTH_REMEDIATION_HINT_REQUEST_ACCESS",
		4: "SHARED_OBJECT_HEALTH_REMEDIATION_HINT_CONTACT_OWNER",
		5: "SHARED_OBJECT_HEALTH_REMEDIATION_HINT_REPAIR_SOURCE_DATA",
	}
	SharedObjectHealthRemediationHint_value = map[string]int32{
		"SHARED_OBJECT_HEALTH_REMEDIATION_HINT_UNKNOWN":            0,
		"SHARED_OBJECT_HEALTH_REMEDIATION_HINT_NONE":               1,
		"SHARED_OBJECT_HEALTH_REMEDIATION_HINT_RETRY":              2,
		"SHARED_OBJECT_HEALTH_REMEDIATION_HINT_REQUEST_ACCESS":     3,
		"SHARED_OBJECT_HEALTH_REMEDIATION_HINT_CONTACT_OWNER":      4,
		"SHARED_OBJECT_HEALTH_REMEDIATION_HINT_REPAIR_SOURCE_DATA": 5,
	}
)

Enum value maps for SharedObjectHealthRemediationHint.

View Source
var (
	SOParticipantRole_name = map[int32]string{
		0: "SOParticipantRole_UNKNOWN",
		1: "SOParticipantRole_READER",
		2: "SOParticipantRole_WRITER",
		3: "SOParticipantRole_VALIDATOR",
		4: "SOParticipantRole_OWNER",
	}
	SOParticipantRole_value = map[string]int32{
		"SOParticipantRole_UNKNOWN":   0,
		"SOParticipantRole_READER":    1,
		"SOParticipantRole_WRITER":    2,
		"SOParticipantRole_VALIDATOR": 3,
		"SOParticipantRole_OWNER":     4,
	}
)

Enum value maps for SOParticipantRole.

View Source
var (
	SOConsensusMode_name = map[int32]string{
		0: "SO_CONSENSUS_MODE_SINGLE_VALIDATOR",
	}
	SOConsensusMode_value = map[string]int32{
		"SO_CONSENSUS_MODE_SINGLE_VALIDATOR": 0,
	}
)

Enum value maps for SOConsensusMode.

View Source
var (
	SOConfigChangeType_name = map[int32]string{
		0: "SO_CONFIG_CHANGE_TYPE_UNKNOWN",
		1: "SO_CONFIG_CHANGE_TYPE_GENESIS",
		2: "SO_CONFIG_CHANGE_TYPE_ADD_PARTICIPANT",
		3: "SO_CONFIG_CHANGE_TYPE_REMOVE_PARTICIPANT",
		4: "SO_CONFIG_CHANGE_TYPE_ADD_INVITE",
		5: "SO_CONFIG_CHANGE_TYPE_REVOKE_INVITE",
		6: "SO_CONFIG_CHANGE_TYPE_INCREMENT_INVITE_USES",
		7: "SO_CONFIG_CHANGE_TYPE_SELF_ENROLL_PEER",
	}
	SOConfigChangeType_value = map[string]int32{
		"SO_CONFIG_CHANGE_TYPE_UNKNOWN":               0,
		"SO_CONFIG_CHANGE_TYPE_GENESIS":               1,
		"SO_CONFIG_CHANGE_TYPE_ADD_PARTICIPANT":       2,
		"SO_CONFIG_CHANGE_TYPE_REMOVE_PARTICIPANT":    3,
		"SO_CONFIG_CHANGE_TYPE_ADD_INVITE":            4,
		"SO_CONFIG_CHANGE_TYPE_REVOKE_INVITE":         5,
		"SO_CONFIG_CHANGE_TYPE_INCREMENT_INVITE_USES": 6,
		"SO_CONFIG_CHANGE_TYPE_SELF_ENROLL_PEER":      7,
	}
)

Enum value maps for SOConfigChangeType.

View Source
var (
	SORevocationReason_name = map[int32]string{
		0: "SO_REVOCATION_REASON_UNKNOWN",
		1: "SO_REVOCATION_REASON_SESSION_REVOKED",
		2: "SO_REVOCATION_REASON_ORG_REMOVED",
		3: "SO_REVOCATION_REASON_OWNER_REMOVED",
		4: "SO_REVOCATION_REASON_INVITE_REVOKED",
	}
	SORevocationReason_value = map[string]int32{
		"SO_REVOCATION_REASON_UNKNOWN":         0,
		"SO_REVOCATION_REASON_SESSION_REVOKED": 1,
		"SO_REVOCATION_REASON_ORG_REMOVED":     2,
		"SO_REVOCATION_REASON_OWNER_REMOVED":   3,
		"SO_REVOCATION_REASON_INVITE_REVOKED":  4,
	}
)

Enum value maps for SORevocationReason.

Functions

func BuildSOClearOperationResultSignatureContext

func BuildSOClearOperationResultSignatureContext(sharedObjectID string, peerID string, localID string) string

BuildSOClearOperationResultSignatureContext builds the context string for a signature on a clear operation result.

func BuildSOGrantEncContext

func BuildSOGrantEncContext(sharedObjectID string, fromPeerID string, recipientPeerID string) string

BuildSOGrantEncContext builds the context string for a encrypt inner on a SOGrant.

func BuildSOGrantSignatureContext

func BuildSOGrantSignatureContext(sharedObjectID string, signerPeerID, recipientPeerID string) string

BuildSOGrantSignatureContext builds the context string for a signature on a SOGrant.

func BuildSOInviteMessage

func BuildSOInviteMessage(
	sharedObjectID string,
	ownerPrivKey crypto.PrivKey,
	role SOParticipantRole,
	providerID string,
	targetPeerID string,
	maxUses uint32,
	expiresAt *timestamppb.Timestamp,
) (*SOInviteMessage, *SOInvite, error)

CreateSOInviteOp creates an invite on the shared object and returns the signed SOInviteMessage for out-of-band distribution.

Generates a random 32-byte token, BLAKE3 hashes it for on-chain storage, builds and signs the SOInviteMessage, then stores the invite metadata in SOState.invites via a signed config chain entry.

func BuildSOOperationRejectionErrorDetailsContext

func BuildSOOperationRejectionErrorDetailsContext(sharedObjectID string, validatorPeerID, submitterPeerID string, opNonce uint64, localID string) string

BuildSOOperationRejectionErrorDetailsEncContext builds the context string for error details on a shared object operation rejection.

func BuildSOOperationRejectionSignatureContext

func BuildSOOperationRejectionSignatureContext(sharedObjectID string, validatorPeerID, submitterPeerID string, opNonce uint64, localID string) string

BuildSOOperationRejectionSignatureContext builds the context string for a validator signature on a shared object operation rejection.

func BuildSOOperationSignatureContext

func BuildSOOperationSignatureContext(sharedObjectID string, peerID string, nonce uint64, localID string) string

BuildSOOperationSignatureContext builds the context string for a participant signature on a shared object operation.

func BuildTargetedAccountSOInviteMessage added in v0.51.2

func BuildTargetedAccountSOInviteMessage(
	sharedObjectID string,
	ownerPrivKey crypto.PrivKey,
	role SOParticipantRole,
	providerID string,
	targetAccountID string,
	maxUses uint32,
	expiresAt *timestamppb.Timestamp,
) (*SOInviteMessage, *SOInvite, error)

BuildTargetedAccountSOInviteMessage builds an invite that requires a targeted provider-account proof before a cloud owner may accept the mailbox entry.

func BuildValidatorRootSignatureContext

func BuildValidatorRootSignatureContext(sharedObjectID string, seqno uint64) string

BuildValidatorRootSignatureContext builds the context string for a validator signature on shared object root.

func CanReadState

func CanReadState(role SOParticipantRole) bool

CanReadState checks if the given role has read access to the state.

func CanWriteOps

func CanWriteOps(role SOParticipantRole) bool

CanWriteOps checks if the given role has access to write ops.

func CheckConsensusAcceptance

func CheckConsensusAcceptance(mode SOConsensusMode, validSigs int) error

CheckConsensusAcceptance checks whether the given number of valid signatures satisfies the consensus mode. Returns an error if consensus is not met.

func CurrentEpochNumber

func CurrentEpochNumber(epochs []*SOKeyEpoch) uint64

CurrentEpochNumber returns the highest epoch number from the list, or 0 if empty.

func HashSOConfigChange

func HashSOConfigChange(entry *SOConfigChange) ([]byte, error)

HashSOConfigChange computes the SHA-256 hash of a serialized SOConfigChange. The signature field is excluded from the hash by zeroing it before marshaling.

func IsOwner

func IsOwner(role SOParticipantRole) bool

IsOwner checks if the given role is the OWNER role.

func IsValidatorOrOwner

func IsValidatorOrOwner(role SOParticipantRole) bool

IsValidatorOrOwner checks if the given role is VALIDATOR or OWNER.

func NewLocalStateStoreRefcount

func NewLocalStateStoreRefcount(
	storeID string,
	access AccessLocalStateStoreFunc,
) *refcount.RefCount[kvtx.Store]

NewLocalStateStoreRefcount constructs a refcount with the LocalStateStore access func.

ctx, target and targetErr can be empty

keepUnref sets if the value should be kept if there are zero references. resolver is the resolver function returns the value and a release function call the released callback if the value is no longer valid.

func NewSOOperationLocalID

func NewSOOperationLocalID() string

NewSOOperationLocalID constructs a new randomized local ID for a op.

func NewSOStateBlock

func NewSOStateBlock() block.Block

NewSOStateBlock constructs a new SOState block.

func NewSharedObjectRefBlock

func NewSharedObjectRefBlock() block.Block

NewSharedObjectRefBlock constructs a new SharedObjectRef block.

func ParseSOOperationLocalID

func ParseSOOperationLocalID(id string) (ulid.ULID, error)

ParseSOOperationLocalID parses and validates the local id is the correct format.

func RedactStepConfig

func RedactStepConfig(step *block_transform.StepConfig) *block_transform.StepConfig

RedactStepConfig returns a copy of the StepConfig with sensitive fields (encryption keys) zeroed. The algorithm and other non-sensitive fields are preserved. Returns the original step unchanged for non-blockenc steps.

func RedactStepConfigs

func RedactStepConfigs(steps []*block_transform.StepConfig) []*block_transform.StepConfig

RedactStepConfigs returns redacted copies of all step configs.

func RemoveSOParticipant

func RemoveSOParticipant(
	ctx context.Context,
	host *SOHost,
	targetPeerIDStr string,
	signerPriv crypto.PrivKey,
	revInfo *SORevocationInfo,
) (bool, error)

RemoveSOParticipant removes a target peer's participant config and grant from a single shared object.

Returns true if the participant was found and removed, false if they were not a participant. Builds a signed SOConfigChange removing the participant and atomically removes the corresponding SOGrant from RootGrants. Does not rotate the transform key; control-plane revocation (P2P block DEX and cloud block exchange denial) handles access removal.

signerPriv must be the private key of an OWNER in the current config.

func RotateTransformKey

func RotateTransformKey(
	privKey crypto.PrivKey,
	sharedObjectID string,
	participants []*SOParticipantConfig,
	currentEpoch uint64,
	currentSeqno uint64,
) (*block_transform.Config, []*SOGrant, *SOKeyEpoch, error)

RotateTransformKey generates a new transform key and creates grants for the given participants. Returns the new transform config, the grants, and the new epoch number. The caller (an OWNER) provides their private key for signing grants and the list of remaining participants (after revocation).

func ValidateInviteUsable

func ValidateInviteUsable(inv *SOInvite) error

ValidateInviteUsable checks whether an invite is currently usable. Returns nil if the invite can accept another use.

func ValidateSOParticipantRole

func ValidateSOParticipantRole(role SOParticipantRole, allowUnknown bool) error

ValidateSOParticipantRole ensures the enum value is within the expected set. If allowUnknown is true, it will allow SOParticipantRole_UNKNOWN as a valid role.

func VerifyConfigChain

func VerifyConfigChain(entries []*SOConfigChange) error

VerifyConfigChain verifies a config change chain from genesis to current. Each entry must have: 1. Monotonically increasing config_seqno (starting from 0) 2. previous_hash matching the hash of the prior entry (genesis has zero previous_hash) 3. Valid authorization according to the change type

func WrapSharedObjectHealthError

func WrapSharedObjectHealthError(
	layer SharedObjectHealthLayer,
	err error,
) error

WrapSharedObjectHealthError wraps err with an attached SharedObjectHealth snapshot.

Types

type AccessLocalStateStoreFunc

type AccessLocalStateStoreFunc func(ctx context.Context, storeID string, released func()) (kvtx.Store, func(), error)

AccessLocalStateStoreFunc implements AccessLocalStateStore.

type InviteHost

type InviteHost interface {
	InviteMutator

	// GetSOHost returns the SOHost for invite operations.
	GetSOHost() *SOHost
	// GetPrivKey returns the private key for signing invite messages.
	GetPrivKey() crypto.PrivKey
	// GetProviderID returns the provider identifier for the invite message.
	GetProviderID() string
}

InviteHost is an optional interface on SharedObject implementations that support invite creation and management. Both local and spacewave providers implement this.

type InviteMutator

type InviteMutator interface {
	// CreateSOInviteOp creates a new invite and returns the signed invite message.
	CreateSOInviteOp(
		ctx context.Context,
		ownerPrivKey crypto.PrivKey,
		role SOParticipantRole,
		providerID string,
		targetPeerID string,
		maxUses uint32,
		expiresAt *timestamppb.Timestamp,
	) (*SOInviteMessage, error)
	// RevokeInvite revokes an invite by ID.
	RevokeInvite(ctx context.Context, signerPrivKey crypto.PrivKey, inviteID string) error
	// IncrementInviteUses increments the use counter for an invite by ID.
	IncrementInviteUses(ctx context.Context, signerPrivKey crypto.PrivKey, inviteID string) error
}

InviteMutator mutates shared-object invite state.

type MountSharedObject

type MountSharedObject interface {
	// Directive indicates MountSharedObject is a directive.
	directive.Directive

	// MountSharedObjectRef returns the shared object ref to mount.
	MountSharedObjectRef() *SharedObjectRef
}

MountSharedObject is a directive to mount a shared object with a provider account.

func NewMountSharedObject

func NewMountSharedObject(ref *SharedObjectRef) MountSharedObject

NewMountSharedObject constructs a new MountSharedObject directive.

type MountSharedObjectBody

type MountSharedObjectBody interface {
	// Directive indicates MountSharedObjectBody is a directive.
	directive.Directive

	// MountSharedObjectBodyRef returns the shared object ref to mount.
	MountSharedObjectBodyRef() *SharedObjectRef
	// MountSharedObjectBodyType returns the shared object body type.
	MountSharedObjectBodyType() string
}

MountSharedObjectBody is a directive to mount the body of a shared object. This typically signals to start a controller which validates + processes the sobject ops.

func NewMountSharedObjectBody

func NewMountSharedObjectBody(ref *SharedObjectRef, bodyType string) MountSharedObjectBody

NewMountSharedObjectBody constructs a new MountSharedObjectBody directive.

type MountSharedObjectBodyValue

type MountSharedObjectBodyValue[T comparable] interface {
	// GetSharedObjectRef returns the shared object handle.
	GetSharedObjectRef() *SharedObjectRef
	// GetSharedObjectBodyType returns the shared object handle.
	GetSharedObjectBodyType() string
	// GetSharedObject returns the shared object handle.
	GetSharedObject() SharedObject
	// GetSharedObjectBody returns the shared object body handle.
	GetSharedObjectBody() T
}

MountSharedObjectBodyValue is the result type for MountSharedObjectBody.

This is the interface exposed by the shared object body handler on the "client side."

func ExMountSharedObjectBody

func ExMountSharedObjectBody[T comparable](
	ctx context.Context,
	b bus.Bus,
	ref *SharedObjectRef,
	bodyType string,
	returnIfIdle bool,
	valDisposeCb func(),
) (MountSharedObjectBodyValue[T], directive.Reference, error)

ExMountSharedObjectBody executes a directive to mount the body of a shared object.

If returnIfIdle is set, returns when the directive becomes idle.

func NewMountSharedObjectBodyValue

func NewMountSharedObjectBodyValue[T comparable](
	ref *SharedObjectRef,
	bodyType string,
	obj SharedObject,
	body T,
) MountSharedObjectBodyValue[T]

NewMountSharedObjectBodyValue constructs a new MountSharedObjectBodyValue.

type MountSharedObjectValue

type MountSharedObjectValue = SharedObject

MountSharedObjectValue is the result type for MountSharedObject.

type ProcessOpsFunc

type ProcessOpsFunc = func(
	ctx context.Context,
	snap SharedObjectStateSnapshot,
	currentStateData []byte,
	ops []*SOOperationInner,
) (rawNextStateData *[]byte, opResults []*SOOperationResult, err error)

ProcessOpsFunc is a function which processes operations against a state. cb is called with the state snapshot and the decoded inner state. If rawNextStateData is nil, no changes will be applied to the state (no-op).

type QueuedSOOperation

type QueuedSOOperation struct {

	// LocalId is the local operation id, must be a valid ulid.
	LocalId string `protobuf:"bytes,1,opt,name=local_id,json=localId,proto3" json:"localId,omitempty"`
	// OpData is the operation data, not transformed.
	OpData []byte `protobuf:"bytes,2,opt,name=op_data,json=opData,proto3" json:"opData,omitempty"`
	// contains filtered or unexported fields
}

QueuedSOOperation is a queued SOOperation which does not yet have an nonce.

func (*QueuedSOOperation) CloneMessageVT

func (m *QueuedSOOperation) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*QueuedSOOperation) CloneVT

func (m *QueuedSOOperation) CloneVT() *QueuedSOOperation

func (*QueuedSOOperation) EqualMessageVT

func (this *QueuedSOOperation) EqualMessageVT(thatMsg any) bool

func (*QueuedSOOperation) EqualVT

func (this *QueuedSOOperation) EqualVT(that *QueuedSOOperation) bool

func (*QueuedSOOperation) GetLocalId

func (x *QueuedSOOperation) GetLocalId() string

func (*QueuedSOOperation) GetOpData

func (x *QueuedSOOperation) GetOpData() []byte

func (*QueuedSOOperation) MarshalJSON

func (x *QueuedSOOperation) MarshalJSON() ([]byte, error)

MarshalJSON marshals the QueuedSOOperation to JSON.

func (*QueuedSOOperation) MarshalProtoJSON

func (x *QueuedSOOperation) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the QueuedSOOperation message to JSON.

func (*QueuedSOOperation) MarshalProtoText

func (x *QueuedSOOperation) MarshalProtoText() string

func (*QueuedSOOperation) MarshalToSizedBufferVT

func (m *QueuedSOOperation) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*QueuedSOOperation) MarshalToVT

func (m *QueuedSOOperation) MarshalToVT(dAtA []byte) (int, error)

func (*QueuedSOOperation) MarshalVT

func (m *QueuedSOOperation) MarshalVT() (dAtA []byte, err error)

func (*QueuedSOOperation) ProtoMessage

func (*QueuedSOOperation) ProtoMessage()

func (*QueuedSOOperation) Reset

func (x *QueuedSOOperation) Reset()

func (*QueuedSOOperation) SizeVT

func (m *QueuedSOOperation) SizeVT() (n int)

func (*QueuedSOOperation) String

func (x *QueuedSOOperation) String() string

func (*QueuedSOOperation) UnmarshalJSON

func (x *QueuedSOOperation) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the QueuedSOOperation from JSON.

func (*QueuedSOOperation) UnmarshalProtoJSON

func (x *QueuedSOOperation) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the QueuedSOOperation message from JSON.

func (*QueuedSOOperation) UnmarshalVT

func (m *QueuedSOOperation) UnmarshalVT(dAtA []byte) error

func (*QueuedSOOperation) Validate

func (q *QueuedSOOperation) Validate() error

Validate performs cursory checks on the QueuedSOOperation.

type SOAccountNonce

type SOAccountNonce struct {

	// PeerId is the identifier of the account.
	PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peerId,omitempty"`
	// Nonce is the current nonce for the account.
	Nonce uint64 `protobuf:"varint,2,opt,name=nonce,proto3" json:"nonce,omitempty"`
	// contains filtered or unexported fields
}

SOAccountNonce contains the current nonce for an account. The accounts are sorted lexicographically by peer_id.

func (*SOAccountNonce) CloneMessageVT

func (m *SOAccountNonce) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SOAccountNonce) CloneVT

func (m *SOAccountNonce) CloneVT() *SOAccountNonce

func (*SOAccountNonce) EqualMessageVT

func (this *SOAccountNonce) EqualMessageVT(thatMsg any) bool

func (*SOAccountNonce) EqualVT

func (this *SOAccountNonce) EqualVT(that *SOAccountNonce) bool

func (*SOAccountNonce) GetNonce

func (x *SOAccountNonce) GetNonce() uint64

func (*SOAccountNonce) GetPeerId

func (x *SOAccountNonce) GetPeerId() string

func (*SOAccountNonce) MarshalJSON

func (x *SOAccountNonce) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SOAccountNonce to JSON.

func (*SOAccountNonce) MarshalProtoJSON

func (x *SOAccountNonce) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SOAccountNonce message to JSON.

func (*SOAccountNonce) MarshalProtoText

func (x *SOAccountNonce) MarshalProtoText() string

func (*SOAccountNonce) MarshalToSizedBufferVT

func (m *SOAccountNonce) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SOAccountNonce) MarshalToVT

func (m *SOAccountNonce) MarshalToVT(dAtA []byte) (int, error)

func (*SOAccountNonce) MarshalVT

func (m *SOAccountNonce) MarshalVT() (dAtA []byte, err error)

func (*SOAccountNonce) ParsePeerID

func (n *SOAccountNonce) ParsePeerID() (peer.ID, error)

ParsePeerID parses the peer ID.

func (*SOAccountNonce) ProtoMessage

func (*SOAccountNonce) ProtoMessage()

func (*SOAccountNonce) Reset

func (x *SOAccountNonce) Reset()

func (*SOAccountNonce) SizeVT

func (m *SOAccountNonce) SizeVT() (n int)

func (*SOAccountNonce) String

func (x *SOAccountNonce) String() string

func (*SOAccountNonce) UnmarshalJSON

func (x *SOAccountNonce) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SOAccountNonce from JSON.

func (*SOAccountNonce) UnmarshalProtoJSON

func (x *SOAccountNonce) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SOAccountNonce message from JSON.

func (*SOAccountNonce) UnmarshalVT

func (m *SOAccountNonce) UnmarshalVT(dAtA []byte) error

type SOClearOperationResult

type SOClearOperationResult struct {

	// Inner is the encoded SOClearOperationResultInner object.
	Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"`
	// Signature is the signature of inner by the operation submitter.
	// The pub key must match the peer id that submitted the original operation.
	Signature *peer.Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
	// contains filtered or unexported fields
}

SOClearOperationResult represents a request to clear a rejected operation result.

func BuildSOClearOperationResult

func BuildSOClearOperationResult(
	sharedObjectID string,
	privKey crypto.PrivKey,
	localID string,
) (*SOClearOperationResult, error)

BuildSOClearOperationResult constructs a new SOClearOperationResult. The privKey must belong to the peer that submitted the original operation.

func (*SOClearOperationResult) CloneMessageVT

func (*SOClearOperationResult) CloneVT

func (*SOClearOperationResult) EqualMessageVT

func (this *SOClearOperationResult) EqualMessageVT(thatMsg any) bool

func (*SOClearOperationResult) EqualVT

func (this *SOClearOperationResult) EqualVT(that *SOClearOperationResult) bool

func (*SOClearOperationResult) GetInner

func (x *SOClearOperationResult) GetInner() []byte

func (*SOClearOperationResult) GetSignature

func (x *SOClearOperationResult) GetSignature() *peer.Signature

func (*SOClearOperationResult) MarshalJSON

func (x *SOClearOperationResult) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SOClearOperationResult to JSON.

func (*SOClearOperationResult) MarshalProtoJSON

func (x *SOClearOperationResult) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SOClearOperationResult message to JSON.

func (*SOClearOperationResult) MarshalProtoText

func (x *SOClearOperationResult) MarshalProtoText() string

func (*SOClearOperationResult) MarshalToSizedBufferVT

func (m *SOClearOperationResult) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SOClearOperationResult) MarshalToVT

func (m *SOClearOperationResult) MarshalToVT(dAtA []byte) (int, error)

func (*SOClearOperationResult) MarshalVT

func (m *SOClearOperationResult) MarshalVT() (dAtA []byte, err error)

func (*SOClearOperationResult) ProtoMessage

func (*SOClearOperationResult) ProtoMessage()

func (*SOClearOperationResult) Reset

func (x *SOClearOperationResult) Reset()

func (*SOClearOperationResult) SizeVT

func (m *SOClearOperationResult) SizeVT() (n int)

func (*SOClearOperationResult) String

func (x *SOClearOperationResult) String() string

func (*SOClearOperationResult) UnmarshalInner

UnmarshalInner unmarshals and verifies the SOClearOperationResultInner.

func (*SOClearOperationResult) UnmarshalJSON

func (x *SOClearOperationResult) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SOClearOperationResult from JSON.

func (*SOClearOperationResult) UnmarshalProtoJSON

func (x *SOClearOperationResult) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SOClearOperationResult message from JSON.

func (*SOClearOperationResult) UnmarshalVT

func (m *SOClearOperationResult) UnmarshalVT(dAtA []byte) error

func (*SOClearOperationResult) Validate

func (c *SOClearOperationResult) Validate() error

Validate performs cursory checks on the SOClearOperationResult.

type SOClearOperationResultInner

type SOClearOperationResultInner struct {

	// PeerId is the identifier of the participant that submitted the operation.
	PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peerId,omitempty"`
	// LocalId is the locally-assigned ulid for the operation.
	// Must be a valid ulid.
	// Must be lower-case.
	LocalId string `protobuf:"bytes,2,opt,name=local_id,json=localId,proto3" json:"localId,omitempty"`
	// contains filtered or unexported fields
}

SOClearOperationResultInner is the inner message of SOClearOperationResult.

func (*SOClearOperationResultInner) CloneMessageVT

func (*SOClearOperationResultInner) CloneVT

func (*SOClearOperationResultInner) EqualMessageVT

func (this *SOClearOperationResultInner) EqualMessageVT(thatMsg any) bool

func (*SOClearOperationResultInner) EqualVT

func (*SOClearOperationResultInner) GetLocalId

func (x *SOClearOperationResultInner) GetLocalId() string

func (*SOClearOperationResultInner) GetPeerId

func (x *SOClearOperationResultInner) GetPeerId() string

func (*SOClearOperationResultInner) MarshalJSON

func (x *SOClearOperationResultInner) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SOClearOperationResultInner to JSON.

func (*SOClearOperationResultInner) MarshalProtoJSON

func (x *SOClearOperationResultInner) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SOClearOperationResultInner message to JSON.

func (*SOClearOperationResultInner) MarshalProtoText

func (x *SOClearOperationResultInner) MarshalProtoText() string

func (*SOClearOperationResultInner) MarshalToSizedBufferVT

func (m *SOClearOperationResultInner) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SOClearOperationResultInner) MarshalToVT

func (m *SOClearOperationResultInner) MarshalToVT(dAtA []byte) (int, error)

func (*SOClearOperationResultInner) MarshalVT

func (m *SOClearOperationResultInner) MarshalVT() (dAtA []byte, err error)

func (*SOClearOperationResultInner) ParsePeerID

func (i *SOClearOperationResultInner) ParsePeerID() (peer.ID, error)

ParsePeerID parses the peer ID.

func (*SOClearOperationResultInner) ProtoMessage

func (*SOClearOperationResultInner) ProtoMessage()

func (*SOClearOperationResultInner) Reset

func (x *SOClearOperationResultInner) Reset()

func (*SOClearOperationResultInner) SizeVT

func (m *SOClearOperationResultInner) SizeVT() (n int)

func (*SOClearOperationResultInner) String

func (x *SOClearOperationResultInner) String() string

func (*SOClearOperationResultInner) UnmarshalJSON

func (x *SOClearOperationResultInner) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SOClearOperationResultInner from JSON.

func (*SOClearOperationResultInner) UnmarshalProtoJSON

func (x *SOClearOperationResultInner) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SOClearOperationResultInner message from JSON.

func (*SOClearOperationResultInner) UnmarshalVT

func (m *SOClearOperationResultInner) UnmarshalVT(dAtA []byte) error

func (*SOClearOperationResultInner) Validate

func (i *SOClearOperationResultInner) Validate() error

Validate performs cursory checks on the SOClearOperationResultInner.

type SOConfigChainResponse

type SOConfigChainResponse struct {

	// ConfigChanges is the full config change chain from genesis.
	ConfigChanges []*SOConfigChange `protobuf:"bytes,1,rep,name=config_changes,json=configChanges,proto3" json:"configChanges,omitempty"`
	// KeyEpochs are the key epochs with grants for each period.
	KeyEpochs []*SOKeyEpoch `protobuf:"bytes,2,rep,name=key_epochs,json=keyEpochs,proto3" json:"keyEpochs,omitempty"`
	// contains filtered or unexported fields
}

SOConfigChainResponse is returned by GET /sobject/{id}/config-chain.

func (*SOConfigChainResponse) CloneMessageVT

func (*SOConfigChainResponse) CloneVT

func (*SOConfigChainResponse) EqualMessageVT

func (this *SOConfigChainResponse) EqualMessageVT(thatMsg any) bool

func (*SOConfigChainResponse) EqualVT

func (this *SOConfigChainResponse) EqualVT(that *SOConfigChainResponse) bool

func (*SOConfigChainResponse) GetConfigChanges

func (x *SOConfigChainResponse) GetConfigChanges() []*SOConfigChange

func (*SOConfigChainResponse) GetKeyEpochs

func (x *SOConfigChainResponse) GetKeyEpochs() []*SOKeyEpoch

func (*SOConfigChainResponse) MarshalJSON

func (x *SOConfigChainResponse) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SOConfigChainResponse to JSON.

func (*SOConfigChainResponse) MarshalProtoJSON

func (x *SOConfigChainResponse) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SOConfigChainResponse message to JSON.

func (*SOConfigChainResponse) MarshalProtoText

func (x *SOConfigChainResponse) MarshalProtoText() string

func (*SOConfigChainResponse) MarshalToSizedBufferVT

func (m *SOConfigChainResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SOConfigChainResponse) MarshalToVT

func (m *SOConfigChainResponse) MarshalToVT(dAtA []byte) (int, error)

func (*SOConfigChainResponse) MarshalVT

func (m *SOConfigChainResponse) MarshalVT() (dAtA []byte, err error)

func (*SOConfigChainResponse) ProtoMessage

func (*SOConfigChainResponse) ProtoMessage()

func (*SOConfigChainResponse) Reset

func (x *SOConfigChainResponse) Reset()

func (*SOConfigChainResponse) SizeVT

func (m *SOConfigChainResponse) SizeVT() (n int)

func (*SOConfigChainResponse) String

func (x *SOConfigChainResponse) String() string

func (*SOConfigChainResponse) UnmarshalJSON

func (x *SOConfigChainResponse) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SOConfigChainResponse from JSON.

func (*SOConfigChainResponse) UnmarshalProtoJSON

func (x *SOConfigChainResponse) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SOConfigChainResponse message from JSON.

func (*SOConfigChainResponse) UnmarshalVT

func (m *SOConfigChainResponse) UnmarshalVT(dAtA []byte) error

type SOConfigChange

type SOConfigChange struct {

	// ConfigSeqno is the sequence number of this config change.
	ConfigSeqno uint64 `protobuf:"varint,1,opt,name=config_seqno,json=configSeqno,proto3" json:"configSeqno,omitempty"`
	// Config is the new config after this change.
	Config *SharedObjectConfig `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"`
	// SignedBy is the peer_id of the OWNER who signed this change.
	SignedBy []byte `protobuf:"bytes,4,opt,name=signed_by,json=signedBy,proto3" json:"signedBy,omitempty"`
	// Signature is the signature over the serialized SOConfigChange (without this field).
	Signature *peer.Signature `protobuf:"bytes,5,opt,name=signature,proto3" json:"signature,omitempty"`
	// PreviousHash is the hash of the previous SOConfigChange entry in the chain.
	PreviousHash []byte `protobuf:"bytes,6,opt,name=previous_hash,json=previousHash,proto3" json:"previousHash,omitempty"`
	// ChangeType describes the kind of mutation in this config chain entry.
	ChangeType SOConfigChangeType `protobuf:"varint,7,opt,name=change_type,json=changeType,proto3" json:"changeType,omitempty"`
	// RevocationInfo contains metadata about why a participant was removed.
	// Only populated when change_type is REMOVE_PARTICIPANT.
	RevocationInfo *SORevocationInfo `protobuf:"bytes,8,opt,name=revocation_info,json=revocationInfo,proto3" json:"revocationInfo,omitempty"`
	// contains filtered or unexported fields
}

SOConfigChange represents a signed config change in the config chain.

func BuildSOConfigChange

func BuildSOConfigChange(
	currentConfig *SharedObjectConfig,
	nextConfig *SharedObjectConfig,
	changeType SOConfigChangeType,
	signerPrivKey crypto.PrivKey,
	revInfo *SORevocationInfo,
) (*SOConfigChange, error)

BuildSOConfigChange constructs and signs a SOConfigChange entry.

currentConfig is the config before the change (used for previous_hash and seqno). nextConfig is the desired config after the change. changeType describes the kind of mutation in this entry. signerPrivKey is the private key of an OWNER in the current config, or the self-enrolling peer for SELF_ENROLL_PEER changes. revInfo is optional revocation metadata (only for REMOVE_PARTICIPANT changes).

func BuildSelfEnrollPeerConfigChange

func BuildSelfEnrollPeerConfigChange(
	currentCfg *SharedObjectConfig,
	signerPriv bifrost_crypto.PrivKey,
	signerPeerID string,
	entityID string,
	role SOParticipantRole,
) (*SOConfigChange, error)

BuildSelfEnrollPeerConfigChange builds a SELF_ENROLL_PEER config change for a missing same-entity session peer.

func (*SOConfigChange) CloneMessageVT

func (m *SOConfigChange) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SOConfigChange) CloneVT

func (m *SOConfigChange) CloneVT() *SOConfigChange

func (*SOConfigChange) EqualMessageVT

func (this *SOConfigChange) EqualMessageVT(thatMsg any) bool

func (*SOConfigChange) EqualVT

func (this *SOConfigChange) EqualVT(that *SOConfigChange) bool

func (*SOConfigChange) GetChangeType

func (x *SOConfigChange) GetChangeType() SOConfigChangeType

func (*SOConfigChange) GetConfig

func (x *SOConfigChange) GetConfig() *SharedObjectConfig

func (*SOConfigChange) GetConfigSeqno

func (x *SOConfigChange) GetConfigSeqno() uint64

func (*SOConfigChange) GetPreviousHash

func (x *SOConfigChange) GetPreviousHash() []byte

func (*SOConfigChange) GetRevocationInfo

func (x *SOConfigChange) GetRevocationInfo() *SORevocationInfo

func (*SOConfigChange) GetSignature

func (x *SOConfigChange) GetSignature() *peer.Signature

func (*SOConfigChange) GetSignedBy

func (x *SOConfigChange) GetSignedBy() []byte

func (*SOConfigChange) MarshalJSON

func (x *SOConfigChange) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SOConfigChange to JSON.

func (*SOConfigChange) MarshalProtoJSON

func (x *SOConfigChange) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SOConfigChange message to JSON.

func (*SOConfigChange) MarshalProtoText

func (x *SOConfigChange) MarshalProtoText() string

func (*SOConfigChange) MarshalToSizedBufferVT

func (m *SOConfigChange) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SOConfigChange) MarshalToVT

func (m *SOConfigChange) MarshalToVT(dAtA []byte) (int, error)

func (*SOConfigChange) MarshalVT

func (m *SOConfigChange) MarshalVT() (dAtA []byte, err error)

func (*SOConfigChange) ProtoMessage

func (*SOConfigChange) ProtoMessage()

func (*SOConfigChange) Reset

func (x *SOConfigChange) Reset()

func (*SOConfigChange) SizeVT

func (m *SOConfigChange) SizeVT() (n int)

func (*SOConfigChange) String

func (x *SOConfigChange) String() string

func (*SOConfigChange) UnmarshalJSON

func (x *SOConfigChange) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SOConfigChange from JSON.

func (*SOConfigChange) UnmarshalProtoJSON

func (x *SOConfigChange) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SOConfigChange message from JSON.

func (*SOConfigChange) UnmarshalVT

func (m *SOConfigChange) UnmarshalVT(dAtA []byte) error

type SOConfigChangeType

type SOConfigChangeType int32

SOConfigChangeType describes the kind of mutation in a config chain entry.

const (
	// SO_CONFIG_CHANGE_TYPE_UNKNOWN is the zero value.
	SOConfigChangeType_SO_CONFIG_CHANGE_TYPE_UNKNOWN SOConfigChangeType = 0
	// SO_CONFIG_CHANGE_TYPE_GENESIS is the initial config chain entry.
	SOConfigChangeType_SO_CONFIG_CHANGE_TYPE_GENESIS SOConfigChangeType = 1
	// SO_CONFIG_CHANGE_TYPE_ADD_PARTICIPANT adds a participant to the config.
	SOConfigChangeType_SO_CONFIG_CHANGE_TYPE_ADD_PARTICIPANT SOConfigChangeType = 2
	// SO_CONFIG_CHANGE_TYPE_REMOVE_PARTICIPANT removes a participant from the config.
	SOConfigChangeType_SO_CONFIG_CHANGE_TYPE_REMOVE_PARTICIPANT SOConfigChangeType = 3
	// SO_CONFIG_CHANGE_TYPE_ADD_INVITE creates a new invite.
	SOConfigChangeType_SO_CONFIG_CHANGE_TYPE_ADD_INVITE SOConfigChangeType = 4
	// SO_CONFIG_CHANGE_TYPE_REVOKE_INVITE revokes an existing invite.
	SOConfigChangeType_SO_CONFIG_CHANGE_TYPE_REVOKE_INVITE SOConfigChangeType = 5
	// SO_CONFIG_CHANGE_TYPE_INCREMENT_INVITE_USES records an invite usage.
	SOConfigChangeType_SO_CONFIG_CHANGE_TYPE_INCREMENT_INVITE_USES SOConfigChangeType = 6
	// SO_CONFIG_CHANGE_TYPE_SELF_ENROLL_PEER lets a same-entity session add itself.
	SOConfigChangeType_SO_CONFIG_CHANGE_TYPE_SELF_ENROLL_PEER SOConfigChangeType = 7
)

func (SOConfigChangeType) Enum

func (SOConfigChangeType) MarshalJSON

func (x SOConfigChangeType) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SOConfigChangeType to JSON.

func (SOConfigChangeType) MarshalProtoJSON

func (x SOConfigChangeType) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SOConfigChangeType to JSON.

func (SOConfigChangeType) MarshalProtoText

func (x SOConfigChangeType) MarshalProtoText() string

func (SOConfigChangeType) MarshalText

func (x SOConfigChangeType) MarshalText() ([]byte, error)

MarshalText marshals the SOConfigChangeType to text.

func (SOConfigChangeType) String

func (x SOConfigChangeType) String() string

func (*SOConfigChangeType) UnmarshalJSON

func (x *SOConfigChangeType) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SOConfigChangeType from JSON.

func (*SOConfigChangeType) UnmarshalProtoJSON

func (x *SOConfigChangeType) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SOConfigChangeType from JSON.

func (*SOConfigChangeType) UnmarshalText

func (x *SOConfigChangeType) UnmarshalText(b []byte) error

UnmarshalText unmarshals the SOConfigChangeType from text.

type SOConsensusMode

type SOConsensusMode int32

SOConsensusMode defines the consensus mechanism for validating root state updates.

const (
	// SO_CONSENSUS_MODE_SINGLE_VALIDATOR requires at least one valid validator signature.
	// This is the default mode and matches the existing behavior.
	SOConsensusMode_SO_CONSENSUS_MODE_SINGLE_VALIDATOR SOConsensusMode = 0
)

func (SOConsensusMode) Enum

func (x SOConsensusMode) Enum() *SOConsensusMode

func (SOConsensusMode) MarshalJSON

func (x SOConsensusMode) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SOConsensusMode to JSON.

func (SOConsensusMode) MarshalProtoJSON

func (x SOConsensusMode) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SOConsensusMode to JSON.

func (SOConsensusMode) MarshalProtoText

func (x SOConsensusMode) MarshalProtoText() string

func (SOConsensusMode) MarshalText

func (x SOConsensusMode) MarshalText() ([]byte, error)

MarshalText marshals the SOConsensusMode to text.

func (SOConsensusMode) String

func (x SOConsensusMode) String() string

func (*SOConsensusMode) UnmarshalJSON

func (x *SOConsensusMode) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SOConsensusMode from JSON.

func (*SOConsensusMode) UnmarshalProtoJSON

func (x *SOConsensusMode) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SOConsensusMode from JSON.

func (*SOConsensusMode) UnmarshalText

func (x *SOConsensusMode) UnmarshalText(b []byte) error

UnmarshalText unmarshals the SOConsensusMode from text.

type SOEntityRecoveryEnvelope

type SOEntityRecoveryEnvelope struct {

	// EntityId is the stable entity identifier the envelope is for.
	EntityId string `protobuf:"bytes,1,opt,name=entity_id,json=entityId,proto3" json:"entityId,omitempty"`
	// KeyEpoch is the current readable key epoch for this envelope.
	KeyEpoch uint64 `protobuf:"varint,2,opt,name=key_epoch,json=keyEpoch,proto3" json:"keyEpoch,omitempty"`
	// ConfigChainSeqno is the config-chain seqno the envelope matches.
	ConfigChainSeqno uint64 `protobuf:"varint,3,opt,name=config_chain_seqno,json=configChainSeqno,proto3" json:"configChainSeqno,omitempty"`
	// ConfigChainHash is the config-chain hash the envelope matches.
	ConfigChainHash []byte `protobuf:"bytes,4,opt,name=config_chain_hash,json=configChainHash,proto3" json:"configChainHash,omitempty"`
	// EnvelopeData is a bifrost/envelope payload encrypted to entity keypairs.
	EnvelopeData []byte `protobuf:"bytes,5,opt,name=envelope_data,json=envelopeData,proto3" json:"envelopeData,omitempty"`
	// contains filtered or unexported fields
}

SOEntityRecoveryEnvelope stores recovery material for one entity on an SO.

func BuildSOEntityRecoveryEnvelope

func BuildSOEntityRecoveryEnvelope(
	entityID string,
	keyEpoch uint64,
	cfg *SharedObjectConfig,
	material *SOEntityRecoveryMaterial,
	recipientPubs []bifrost_crypto.PubKey,
) (*SOEntityRecoveryEnvelope, error)

BuildSOEntityRecoveryEnvelope builds an entity recovery envelope for the current SO grant material.

func (*SOEntityRecoveryEnvelope) CloneMessageVT

func (*SOEntityRecoveryEnvelope) CloneVT

func (*SOEntityRecoveryEnvelope) EqualMessageVT

func (this *SOEntityRecoveryEnvelope) EqualMessageVT(thatMsg any) bool

func (*SOEntityRecoveryEnvelope) EqualVT

func (*SOEntityRecoveryEnvelope) GetConfigChainHash

func (x *SOEntityRecoveryEnvelope) GetConfigChainHash() []byte

func (*SOEntityRecoveryEnvelope) GetConfigChainSeqno

func (x *SOEntityRecoveryEnvelope) GetConfigChainSeqno() uint64

func (*SOEntityRecoveryEnvelope) GetEntityId

func (x *SOEntityRecoveryEnvelope) GetEntityId() string

func (*SOEntityRecoveryEnvelope) GetEnvelopeData

func (x *SOEntityRecoveryEnvelope) GetEnvelopeData() []byte

func (*SOEntityRecoveryEnvelope) GetKeyEpoch

func (x *SOEntityRecoveryEnvelope) GetKeyEpoch() uint64

func (*SOEntityRecoveryEnvelope) MarshalJSON

func (x *SOEntityRecoveryEnvelope) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SOEntityRecoveryEnvelope to JSON.

func (*SOEntityRecoveryEnvelope) MarshalProtoJSON

func (x *SOEntityRecoveryEnvelope) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SOEntityRecoveryEnvelope message to JSON.

func (*SOEntityRecoveryEnvelope) MarshalProtoText

func (x *SOEntityRecoveryEnvelope) MarshalProtoText() string

func (*SOEntityRecoveryEnvelope) MarshalToSizedBufferVT

func (m *SOEntityRecoveryEnvelope) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SOEntityRecoveryEnvelope) MarshalToVT

func (m *SOEntityRecoveryEnvelope) MarshalToVT(dAtA []byte) (int, error)

func (*SOEntityRecoveryEnvelope) MarshalVT

func (m *SOEntityRecoveryEnvelope) MarshalVT() (dAtA []byte, err error)

func (*SOEntityRecoveryEnvelope) ProtoMessage

func (*SOEntityRecoveryEnvelope) ProtoMessage()

func (*SOEntityRecoveryEnvelope) Reset

func (x *SOEntityRecoveryEnvelope) Reset()

func (*SOEntityRecoveryEnvelope) SizeVT

func (m *SOEntityRecoveryEnvelope) SizeVT() (n int)

func (*SOEntityRecoveryEnvelope) String

func (x *SOEntityRecoveryEnvelope) String() string

func (*SOEntityRecoveryEnvelope) UnmarshalJSON

func (x *SOEntityRecoveryEnvelope) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SOEntityRecoveryEnvelope from JSON.

func (*SOEntityRecoveryEnvelope) UnmarshalProtoJSON

func (x *SOEntityRecoveryEnvelope) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SOEntityRecoveryEnvelope message from JSON.

func (*SOEntityRecoveryEnvelope) UnmarshalVT

func (m *SOEntityRecoveryEnvelope) UnmarshalVT(dAtA []byte) error

type SOEntityRecoveryMaterial

type SOEntityRecoveryMaterial struct {

	// EntityId is the stable entity identifier this material is for.
	EntityId string `protobuf:"bytes,1,opt,name=entity_id,json=entityId,proto3" json:"entityId,omitempty"`
	// Role is the maximum role the entity may self-rejoin with.
	Role SOParticipantRole `protobuf:"varint,2,opt,name=role,proto3" json:"role,omitempty"`
	// GrantInner is the current grant material used to mint a peer grant.
	GrantInner *SOGrantInner `protobuf:"bytes,3,opt,name=grant_inner,json=grantInner,proto3" json:"grantInner,omitempty"`
	// contains filtered or unexported fields
}

SOEntityRecoveryMaterial is the decrypted recovery material for one entity.

func ResolveSharedObjectRecoveryMaterial

func ResolveSharedObjectRecoveryMaterial(
	ctx context.Context,
	provAcc provider.ProviderAccount,
	ref *SharedObjectRef,
) (*SOEntityRecoveryMaterial, error)

ResolveSharedObjectRecoveryMaterial resolves the recovery material for an SO using the provider feature surface.

func UnlockSOEntityRecoveryEnvelope

func UnlockSOEntityRecoveryEnvelope(entityPrivKeys []bifrost_crypto.PrivKey, env *SOEntityRecoveryEnvelope) (*SOEntityRecoveryMaterial, error)

UnlockSOEntityRecoveryEnvelope decrypts a recovery envelope into recovery material.

func (*SOEntityRecoveryMaterial) CloneMessageVT

func (*SOEntityRecoveryMaterial) CloneVT

func (*SOEntityRecoveryMaterial) EqualMessageVT

func (this *SOEntityRecoveryMaterial) EqualMessageVT(thatMsg any) bool

func (*SOEntityRecoveryMaterial) EqualVT

func (*SOEntityRecoveryMaterial) GetEntityId

func (x *SOEntityRecoveryMaterial) GetEntityId() string

func (*SOEntityRecoveryMaterial) GetGrantInner

func (x *SOEntityRecoveryMaterial) GetGrantInner() *SOGrantInner

func (*SOEntityRecoveryMaterial) GetRole

func (*SOEntityRecoveryMaterial) MarshalJSON

func (x *SOEntityRecoveryMaterial) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SOEntityRecoveryMaterial to JSON.

func (*SOEntityRecoveryMaterial) MarshalProtoJSON

func (x *SOEntityRecoveryMaterial) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SOEntityRecoveryMaterial message to JSON.

func (*SOEntityRecoveryMaterial) MarshalProtoText

func (x *SOEntityRecoveryMaterial) MarshalProtoText() string

func (*SOEntityRecoveryMaterial) MarshalToSizedBufferVT

func (m *SOEntityRecoveryMaterial) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SOEntityRecoveryMaterial) MarshalToVT

func (m *SOEntityRecoveryMaterial) MarshalToVT(dAtA []byte) (int, error)

func (*SOEntityRecoveryMaterial) MarshalVT

func (m *SOEntityRecoveryMaterial) MarshalVT() (dAtA []byte, err error)

func (*SOEntityRecoveryMaterial) ProtoMessage

func (*SOEntityRecoveryMaterial) ProtoMessage()

func (*SOEntityRecoveryMaterial) Reset

func (x *SOEntityRecoveryMaterial) Reset()

func (*SOEntityRecoveryMaterial) SizeVT

func (m *SOEntityRecoveryMaterial) SizeVT() (n int)

func (*SOEntityRecoveryMaterial) String

func (x *SOEntityRecoveryMaterial) String() string

func (*SOEntityRecoveryMaterial) UnmarshalJSON

func (x *SOEntityRecoveryMaterial) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SOEntityRecoveryMaterial from JSON.

func (*SOEntityRecoveryMaterial) UnmarshalProtoJSON

func (x *SOEntityRecoveryMaterial) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SOEntityRecoveryMaterial message from JSON.

func (*SOEntityRecoveryMaterial) UnmarshalVT

func (m *SOEntityRecoveryMaterial) UnmarshalVT(dAtA []byte) error

type SOGrant

type SOGrant struct {

	// PeerId is the peer id of the target of the grant.
	// Must match a peer id of a participant on the shared object.
	PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peerId,omitempty"`
	// InnerData is the inner SOGrantInner encrypted to the peer id.
	InnerData []byte `protobuf:"bytes,2,opt,name=inner_data,json=innerData,proto3" json:"innerData,omitempty"`
	// Signature is the signature of inner_data by the peer that issued the grant.
	Signature *peer.Signature `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"`
	// contains filtered or unexported fields
}

SOGrant is a grant of a transform configuration to a peer.

func AddSOParticipant

func AddSOParticipant(
	ctx context.Context,
	host *SOHost,
	soID string,
	localPriv crypto.PrivKey,
	localPeerIDStr string,
	targetPeerIDStr string,
	targetPub crypto.PubKey,
	role SOParticipantRole,
	entityID string,
) (*SOGrant, error)

AddSOParticipant adds a target peer as a participant on a single shared object and issues an encrypted grant for the peer.

Reads the current SOState, checks for duplicate participant, builds a signed SOConfigChange adding the participant, and applies it atomically with a new SOGrant encrypted to the target's public key.

Returns the newly created SOGrant for the target peer, or nil if the participant already existed (no-op).

localPriv must be the private key of an OWNER in the current config. localPeerIDStr is the base58 peer ID corresponding to localPriv.

func BuildSelfEnrollPeerGrant

func BuildSelfEnrollPeerGrant(
	signerPriv bifrost_crypto.PrivKey,
	peerID bifrost_peer.ID,
	sharedObjectID string,
	material *SOEntityRecoveryMaterial,
) (*SOGrant, error)

BuildSelfEnrollPeerGrant builds a self-issued grant for the newly enrolled peer using recovered grant material.

func EncryptSOGrant

func EncryptSOGrant(privKey crypto.PrivKey, toPubKey crypto.PubKey, sharedObjectID string, nextInner *SOGrantInner) (*SOGrant, error)

EncryptSOGrant encrypts the inner data of a SOGrant. The privKey is also used to sign the inner data.

func (*SOGrant) CloneMessageVT

func (m *SOGrant) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SOGrant) CloneVT

func (m *SOGrant) CloneVT() *SOGrant

func (*SOGrant) DecryptInnerData

func (g *SOGrant) DecryptInnerData(privKey crypto.PrivKey, sharedObjectID string) (*SOGrantInner, error)

DecryptInnerData decrypts the inner data of a SOGrant.

func (*SOGrant) EqualMessageVT

func (this *SOGrant) EqualMessageVT(thatMsg any) bool

func (*SOGrant) EqualVT

func (this *SOGrant) EqualVT(that *SOGrant) bool

func (*SOGrant) GetInnerData

func (x *SOGrant) GetInnerData() []byte

func (*SOGrant) GetPeerId

func (x *SOGrant) GetPeerId() string

func (*SOGrant) GetSignature

func (x *SOGrant) GetSignature() *peer.Signature

func (*SOGrant) MarshalJSON

func (x *SOGrant) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SOGrant to JSON.

func (*SOGrant) MarshalProtoJSON

func (x *SOGrant) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SOGrant message to JSON.

func (*SOGrant) MarshalProtoText

func (x *SOGrant) MarshalProtoText() string

func (*SOGrant) MarshalToSizedBufferVT

func (m *SOGrant) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SOGrant) MarshalToVT

func (m *SOGrant) MarshalToVT(dAtA []byte) (int, error)

func (*SOGrant) MarshalVT

func (m *SOGrant) MarshalVT() (dAtA []byte, err error)

func (*SOGrant) ParsePeerID

func (g *SOGrant) ParsePeerID() (peer.ID, error)

ParsePeerID parses the peer ID.

func (*SOGrant) ProtoMessage

func (*SOGrant) ProtoMessage()

func (*SOGrant) Reset

func (x *SOGrant) Reset()

func (*SOGrant) SizeVT

func (m *SOGrant) SizeVT() (n int)

func (*SOGrant) String

func (x *SOGrant) String() string

func (*SOGrant) UnmarshalJSON

func (x *SOGrant) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SOGrant from JSON.

func (*SOGrant) UnmarshalProtoJSON

func (x *SOGrant) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SOGrant message from JSON.

func (*SOGrant) UnmarshalVT

func (m *SOGrant) UnmarshalVT(dAtA []byte) error

func (*SOGrant) Validate

func (g *SOGrant) Validate() error

Validate performs cursory checks on the SOGrant.

func (*SOGrant) ValidateSignature

func (g *SOGrant) ValidateSignature(sharedObjectID string, participants []*SOParticipantConfig) error

ValidateSignature validates the signature on a SOGrant.

type SOGrantInner

type SOGrantInner struct {

	// TransformConf is the transform config within the grant.
	// Usually contains a crypto key.
	TransformConf *transform.Config `protobuf:"bytes,1,opt,name=transform_conf,json=transformConf,proto3" json:"transformConf,omitempty"`
	// contains filtered or unexported fields
}

SOGrantInner is the inner encrypted body of the SOGrant.

func (*SOGrantInner) CloneMessageVT

func (m *SOGrantInner) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SOGrantInner) CloneVT

func (m *SOGrantInner) CloneVT() *SOGrantInner

func (*SOGrantInner) EqualMessageVT

func (this *SOGrantInner) EqualMessageVT(thatMsg any) bool

func (*SOGrantInner) EqualVT

func (this *SOGrantInner) EqualVT(that *SOGrantInner) bool

func (*SOGrantInner) GetTransformConf

func (x *SOGrantInner) GetTransformConf() *transform.Config

func (*SOGrantInner) MarshalJSON

func (x *SOGrantInner) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SOGrantInner to JSON.

func (*SOGrantInner) MarshalProtoJSON

func (x *SOGrantInner) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SOGrantInner message to JSON.

func (*SOGrantInner) MarshalProtoText

func (x *SOGrantInner) MarshalProtoText() string

func (*SOGrantInner) MarshalToSizedBufferVT

func (m *SOGrantInner) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SOGrantInner) MarshalToVT

func (m *SOGrantInner) MarshalToVT(dAtA []byte) (int, error)

func (*SOGrantInner) MarshalVT

func (m *SOGrantInner) MarshalVT() (dAtA []byte, err error)

func (*SOGrantInner) ProtoMessage

func (*SOGrantInner) ProtoMessage()

func (*SOGrantInner) Reset

func (x *SOGrantInner) Reset()

func (*SOGrantInner) SizeVT

func (m *SOGrantInner) SizeVT() (n int)

func (*SOGrantInner) String

func (x *SOGrantInner) String() string

func (*SOGrantInner) UnmarshalJSON

func (x *SOGrantInner) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SOGrantInner from JSON.

func (*SOGrantInner) UnmarshalProtoJSON

func (x *SOGrantInner) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SOGrantInner message from JSON.

func (*SOGrantInner) UnmarshalVT

func (m *SOGrantInner) UnmarshalVT(dAtA []byte) error

func (*SOGrantInner) Validate

func (g *SOGrantInner) Validate() error

Validate performs cursory checks on the SOGrantInner.

type SOHost

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

SOHost is the implementation of the shared object host logic for a SOState container.

func NewSOHost

func NewSOHost(ctx context.Context, watchFn SOStateWatchFunc, lockFn SOStateLockFunc, sharedObjectID string) *SOHost

NewSOHost constructs a new shared object host.

ctx can be nil

func (*SOHost) ApplyConfigChange

func (s *SOHost) ApplyConfigChange(ctx context.Context, entry *SOConfigChange, fn func(state *SOState) error) error

ApplyConfigChange applies a signed SOConfigChange to the shared object state.

Verifies chain integrity (previous_hash matches current config_chain_hash, authorization from the current config), then replaces the config with the entry's config and updates the config_chain_hash.

If fn is non-nil it is called after the config is applied but before the state is written, allowing additional atomic mutations (e.g. grant issuance).

func (*SOHost) ClearContext

func (s *SOHost) ClearContext()

ClearContext clears the context and shuts down all routines.

func (*SOHost) ClearRejectedOperation

func (s *SOHost) ClearRejectedOperation(ctx context.Context, clearOp *SOClearOperationResult) error

ClearRejectedOperation clears a rejected operation from the state. The clear operation must be signed by the peer that submitted the original operation.

func (*SOHost) CreateInvite

func (s *SOHost) CreateInvite(
	ctx context.Context,
	signerPrivKey crypto.PrivKey,
	invite *SOInvite,
) error

CreateInvite creates a new invite on the shared object via a signed config chain entry. The invite is appended to SOState.invites. The config itself does not change; the chain entry records the authorized operation.

func (*SOHost) CreateSOInviteOp

func (s *SOHost) CreateSOInviteOp(
	ctx context.Context,
	ownerPrivKey crypto.PrivKey,
	role SOParticipantRole,
	providerID string,
	targetPeerID string,
	maxUses uint32,
	expiresAt *timestamppb.Timestamp,
) (*SOInviteMessage, error)

CreateSOInviteOp creates an invite on the shared object and returns the signed SOInviteMessage for out-of-band distribution.

Generates a random 32-byte token, BLAKE3 hashes it for on-chain storage, builds and signs the SOInviteMessage, then stores the invite metadata in SOState.invites via a signed config chain entry.

func (*SOHost) CreateTargetedAccountSOInviteOp added in v0.51.2

func (s *SOHost) CreateTargetedAccountSOInviteOp(
	ctx context.Context,
	ownerPrivKey crypto.PrivKey,
	role SOParticipantRole,
	providerID string,
	targetAccountID string,
	maxUses uint32,
	expiresAt *timestamppb.Timestamp,
) (*SOInviteMessage, error)

CreateTargetedAccountSOInviteOp creates an invite that requires a targeted provider-account proof before a cloud owner may accept the mailbox entry.

func (*SOHost) GetHostState

func (s *SOHost) GetHostState(ctx context.Context) (*SOState, error)

GetHostState returns a snapshot of the current SOState.

func (*SOHost) GetRootInnerState

func (s *SOHost) GetRootInnerState(ctx context.Context) (*SORootInner, *SORoot, error)

GetRootInnerState returns a snapshot of the SORoot and unmarshals the SORootInner.

func (*SOHost) GetRootState

func (s *SOHost) GetRootState(ctx context.Context) (*SORoot, error)

GetRootState returns a snapshot of the current root state.

func (*SOHost) GetSOStateCtr

func (s *SOHost) GetSOStateCtr(ctx context.Context, released func()) (ccontainer.Watchable[*SOState], func(), error)

GetSOStateCtr watches the shared object state with the refcount container.

func (*SOHost) GetSharedObjectID

func (s *SOHost) GetSharedObjectID() string

GetSharedObjectID returns the sharedObjectID for the SOHost.

func (*SOHost) IncrementInviteUses

func (s *SOHost) IncrementInviteUses(
	ctx context.Context,
	signerPrivKey crypto.PrivKey,
	inviteID string,
) error

IncrementInviteUses increments the uses counter on an invite via a signed config chain entry. Returns an error if the invite is invalid, revoked, expired, or has reached max_uses.

func (*SOHost) QueueOperation

func (s *SOHost) QueueOperation(
	ctx context.Context,
	peerID peer.ID,
	cb func(nonce uint64) (*SOOperation, error),
) error

QueueOperation locks the host state and applies the QueueOperation operation.

Calls the callback to build the SOOperation with the given nonce.

Returns an error if the operation cannot be queued or if the nonce doesn't match the expected value.

func (*SOHost) RevokeInvite

func (s *SOHost) RevokeInvite(
	ctx context.Context,
	signerPrivKey crypto.PrivKey,
	inviteID string,
) error

RevokeInvite revokes an existing invite on the shared object via a signed config chain entry. Sets revoked=true on the matching invite.

func (*SOHost) SetContext

func (s *SOHost) SetContext(ctx context.Context) bool

SetContext updates the context on the refcount.

Returns if the context was updated.

func (*SOHost) UpdateRootState

func (s *SOHost) UpdateRootState(
	ctx context.Context,
	nextRootState *SORoot,
	enforceValidatorPeerID string,
	rejectedOps []*SOOperationRejection,
	acceptedOps []*SOOperation,
) error

UpdateRootState locks the host state and applies the UpdateRootState operation.

If an error is returned the SOState should be considered invalid. If enforceValidatorPeerID is non-empty, ensures the given validator is in the set of signatures.

func (*SOHost) UpdateSOState

func (s *SOHost) UpdateSOState(ctx context.Context, fn func(state *SOState) error) error

UpdateSOState locks the SO state, clones it, calls the provided function to mutate the clone, then writes the updated state.

type SOInvite

type SOInvite struct {

	// InviteId is the unique identifier for this invite.
	InviteId string `protobuf:"bytes,1,opt,name=invite_id,json=inviteId,proto3" json:"inviteId,omitempty"`
	// TokenHash is the BLAKE3 hash of the invite token.
	// The raw token is never stored on-chain.
	TokenHash []byte `protobuf:"bytes,2,opt,name=token_hash,json=tokenHash,proto3" json:"tokenHash,omitempty"`
	// Role is the role granted to the invitee on acceptance.
	Role SOParticipantRole `protobuf:"varint,3,opt,name=role,proto3" json:"role,omitempty"`
	// TargetPeerId is the optional peer ID of the intended invitee.
	// Empty means open invite (anyone with the token can join).
	TargetPeerId string `protobuf:"bytes,4,opt,name=target_peer_id,json=targetPeerId,proto3" json:"targetPeerId,omitempty"`
	// MaxUses is the maximum number of times the invite can be used.
	// 0 means unlimited.
	MaxUses uint32 `protobuf:"varint,5,opt,name=max_uses,json=maxUses,proto3" json:"maxUses,omitempty"`
	// Uses is the current number of times the invite has been used.
	Uses uint32 `protobuf:"varint,6,opt,name=uses,proto3" json:"uses,omitempty"`
	// ExpiresAt is the time after which the invite is invalid.
	// Unset means no expiry.
	ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=expires_at,json=expiresAt,proto3" json:"expiresAt,omitempty"`
	// Revoked indicates the invite has been revoked by the owner.
	Revoked bool `protobuf:"varint,8,opt,name=revoked,proto3" json:"revoked,omitempty"`
	// TargetAccountId is the optional provider account id required to submit a
	// targeted invitation proof for this invite. Empty means bearer invite.
	TargetAccountId string `protobuf:"bytes,9,opt,name=target_account_id,json=targetAccountId,proto3" json:"targetAccountId,omitempty"`
	// contains filtered or unexported fields
}

SOInvite is a pending invite on a SharedObject. Stored in plaintext on SOState (not in encrypted SORoot).

func FindInvite

func FindInvite(state *SOState, inviteID string) *SOInvite

FindInvite returns the invite with the given ID from the state, or nil.

func (*SOInvite) CloneMessageVT

func (m *SOInvite) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SOInvite) CloneVT

func (m *SOInvite) CloneVT() *SOInvite

func (*SOInvite) EqualMessageVT

func (this *SOInvite) EqualMessageVT(thatMsg any) bool

func (*SOInvite) EqualVT

func (this *SOInvite) EqualVT(that *SOInvite) bool

func (*SOInvite) GetExpiresAt

func (x *SOInvite) GetExpiresAt() *timestamppb.Timestamp

func (*SOInvite) GetInviteId

func (x *SOInvite) GetInviteId() string

func (*SOInvite) GetMaxUses

func (x *SOInvite) GetMaxUses() uint32

func (*SOInvite) GetRevoked

func (x *SOInvite) GetRevoked() bool

func (*SOInvite) GetRole

func (x *SOInvite) GetRole() SOParticipantRole

func (*SOInvite) GetTargetAccountId added in v0.51.2

func (x *SOInvite) GetTargetAccountId() string

func (*SOInvite) GetTargetPeerId

func (x *SOInvite) GetTargetPeerId() string

func (*SOInvite) GetTokenHash

func (x *SOInvite) GetTokenHash() []byte

func (*SOInvite) GetUses

func (x *SOInvite) GetUses() uint32

func (*SOInvite) MarshalJSON

func (x *SOInvite) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SOInvite to JSON.

func (*SOInvite) MarshalProtoJSON

func (x *SOInvite) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SOInvite message to JSON.

func (*SOInvite) MarshalProtoText

func (x *SOInvite) MarshalProtoText() string

func (*SOInvite) MarshalToSizedBufferVT

func (m *SOInvite) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SOInvite) MarshalToVT

func (m *SOInvite) MarshalToVT(dAtA []byte) (int, error)

func (*SOInvite) MarshalVT

func (m *SOInvite) MarshalVT() (dAtA []byte, err error)

func (*SOInvite) ProtoMessage

func (*SOInvite) ProtoMessage()

func (*SOInvite) Reset

func (x *SOInvite) Reset()

func (*SOInvite) SizeVT

func (m *SOInvite) SizeVT() (n int)

func (*SOInvite) String

func (x *SOInvite) String() string

func (*SOInvite) UnmarshalJSON

func (x *SOInvite) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SOInvite from JSON.

func (*SOInvite) UnmarshalProtoJSON

func (x *SOInvite) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SOInvite message from JSON.

func (*SOInvite) UnmarshalVT

func (m *SOInvite) UnmarshalVT(dAtA []byte) error

type SOInviteMessage

type SOInviteMessage struct {

	// InviteId is the unique identifier for this invite.
	InviteId string `protobuf:"bytes,1,opt,name=invite_id,json=inviteId,proto3" json:"inviteId,omitempty"`
	// SharedObjectId is the ID of the shared object being shared.
	SharedObjectId string `protobuf:"bytes,2,opt,name=shared_object_id,json=sharedObjectId,proto3" json:"sharedObjectId,omitempty"`
	// OwnerPeerId is the peer ID of the invite creator (b58).
	OwnerPeerId string `protobuf:"bytes,3,opt,name=owner_peer_id,json=ownerPeerId,proto3" json:"ownerPeerId,omitempty"`
	// ProviderId is the provider to use for signaling (not a raw URL).
	ProviderId string `protobuf:"bytes,4,opt,name=provider_id,json=providerId,proto3" json:"providerId,omitempty"`
	// Token is the raw invite token. The BLAKE3 hash is stored on-chain.
	Token []byte `protobuf:"bytes,5,opt,name=token,proto3" json:"token,omitempty"`
	// Role is the role granted to the invitee on acceptance.
	Role SOParticipantRole `protobuf:"varint,6,opt,name=role,proto3" json:"role,omitempty"`
	// TargetPeerId is the optional peer ID of the intended invitee (b58).
	// Empty means open invite.
	TargetPeerId string `protobuf:"bytes,7,opt,name=target_peer_id,json=targetPeerId,proto3" json:"targetPeerId,omitempty"`
	// ExpiresAt is the time after which the invite is invalid.
	// Unset means no expiry.
	ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=expires_at,json=expiresAt,proto3" json:"expiresAt,omitempty"`
	// MaxUses is the maximum number of times the invite can be used.
	// 0 means unlimited.
	MaxUses uint32 `protobuf:"varint,9,opt,name=max_uses,json=maxUses,proto3" json:"maxUses,omitempty"`
	// Signature is the owner's signature over this message (without this field).
	Signature *peer.Signature `protobuf:"bytes,10,opt,name=signature,proto3" json:"signature,omitempty"`
	// contains filtered or unexported fields
}

SOInviteMessage is a signed invite distributed out-of-band to an invitee. The raw token is included (unlike SOInvite which stores only the hash).

func (*SOInviteMessage) CloneMessageVT

func (m *SOInviteMessage) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SOInviteMessage) CloneVT

func (m *SOInviteMessage) CloneVT() *SOInviteMessage

func (*SOInviteMessage) EqualMessageVT

func (this *SOInviteMessage) EqualMessageVT(thatMsg any) bool

func (*SOInviteMessage) EqualVT

func (this *SOInviteMessage) EqualVT(that *SOInviteMessage) bool

func (*SOInviteMessage) GetExpiresAt

func (x *SOInviteMessage) GetExpiresAt() *timestamppb.Timestamp

func (*SOInviteMessage) GetInviteId

func (x *SOInviteMessage) GetInviteId() string

func (*SOInviteMessage) GetMaxUses

func (x *SOInviteMessage) GetMaxUses() uint32

func (*SOInviteMessage) GetOwnerPeerId

func (x *SOInviteMessage) GetOwnerPeerId() string

func (*SOInviteMessage) GetProviderId

func (x *SOInviteMessage) GetProviderId() string

func (*SOInviteMessage) GetRole

func (x *SOInviteMessage) GetRole() SOParticipantRole

func (*SOInviteMessage) GetSharedObjectId

func (x *SOInviteMessage) GetSharedObjectId() string

func (*SOInviteMessage) GetSignature

func (x *SOInviteMessage) GetSignature() *peer.Signature

func (*SOInviteMessage) GetTargetPeerId

func (x *SOInviteMessage) GetTargetPeerId() string

func (*SOInviteMessage) GetToken

func (x *SOInviteMessage) GetToken() []byte

func (*SOInviteMessage) MarshalJSON

func (x *SOInviteMessage) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SOInviteMessage to JSON.

func (*SOInviteMessage) MarshalProtoJSON

func (x *SOInviteMessage) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SOInviteMessage message to JSON.

func (*SOInviteMessage) MarshalProtoText

func (x *SOInviteMessage) MarshalProtoText() string

func (*SOInviteMessage) MarshalToSizedBufferVT

func (m *SOInviteMessage) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SOInviteMessage) MarshalToVT

func (m *SOInviteMessage) MarshalToVT(dAtA []byte) (int, error)

func (*SOInviteMessage) MarshalVT

func (m *SOInviteMessage) MarshalVT() (dAtA []byte, err error)

func (*SOInviteMessage) ProtoMessage

func (*SOInviteMessage) ProtoMessage()

func (*SOInviteMessage) Reset

func (x *SOInviteMessage) Reset()

func (*SOInviteMessage) SizeVT

func (m *SOInviteMessage) SizeVT() (n int)

func (*SOInviteMessage) String

func (x *SOInviteMessage) String() string

func (*SOInviteMessage) UnmarshalJSON

func (x *SOInviteMessage) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SOInviteMessage from JSON.

func (*SOInviteMessage) UnmarshalProtoJSON

func (x *SOInviteMessage) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SOInviteMessage message from JSON.

func (*SOInviteMessage) UnmarshalVT

func (m *SOInviteMessage) UnmarshalVT(dAtA []byte) error

type SOJoinResponse

type SOJoinResponse struct {

	// InviteId is the invite being accepted.
	InviteId string `protobuf:"bytes,1,opt,name=invite_id,json=inviteId,proto3" json:"inviteId,omitempty"`
	// ResponderPeerId is the peer ID of the responder (b58).
	ResponderPeerId string `protobuf:"bytes,2,opt,name=responder_peer_id,json=responderPeerId,proto3" json:"responderPeerId,omitempty"`
	// ResponderPubkey is the DER-encoded public key of the responder.
	ResponderPubkey []byte `protobuf:"bytes,3,opt,name=responder_pubkey,json=responderPubkey,proto3" json:"responderPubkey,omitempty"`
	// Signature is the responder's signature over this message (without this field).
	Signature *peer.Signature `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty"`
	// contains filtered or unexported fields
}

SOJoinResponse is a signed response from an invitee requesting to join.

func (*SOJoinResponse) CloneMessageVT

func (m *SOJoinResponse) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SOJoinResponse) CloneVT

func (m *SOJoinResponse) CloneVT() *SOJoinResponse

func (*SOJoinResponse) EqualMessageVT

func (this *SOJoinResponse) EqualMessageVT(thatMsg any) bool

func (*SOJoinResponse) EqualVT

func (this *SOJoinResponse) EqualVT(that *SOJoinResponse) bool

func (*SOJoinResponse) GetInviteId

func (x *SOJoinResponse) GetInviteId() string

func (*SOJoinResponse) GetResponderPeerId

func (x *SOJoinResponse) GetResponderPeerId() string

func (*SOJoinResponse) GetResponderPubkey

func (x *SOJoinResponse) GetResponderPubkey() []byte

func (*SOJoinResponse) GetSignature

func (x *SOJoinResponse) GetSignature() *peer.Signature

func (*SOJoinResponse) MarshalJSON

func (x *SOJoinResponse) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SOJoinResponse to JSON.

func (*SOJoinResponse) MarshalProtoJSON

func (x *SOJoinResponse) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SOJoinResponse message to JSON.

func (*SOJoinResponse) MarshalProtoText

func (x *SOJoinResponse) MarshalProtoText() string

func (*SOJoinResponse) MarshalToSizedBufferVT

func (m *SOJoinResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SOJoinResponse) MarshalToVT

func (m *SOJoinResponse) MarshalToVT(dAtA []byte) (int, error)

func (*SOJoinResponse) MarshalVT

func (m *SOJoinResponse) MarshalVT() (dAtA []byte, err error)

func (*SOJoinResponse) ProtoMessage

func (*SOJoinResponse) ProtoMessage()

func (*SOJoinResponse) Reset

func (x *SOJoinResponse) Reset()

func (*SOJoinResponse) SizeVT

func (m *SOJoinResponse) SizeVT() (n int)

func (*SOJoinResponse) String

func (x *SOJoinResponse) String() string

func (*SOJoinResponse) UnmarshalJSON

func (x *SOJoinResponse) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SOJoinResponse from JSON.

func (*SOJoinResponse) UnmarshalProtoJSON

func (x *SOJoinResponse) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SOJoinResponse message from JSON.

func (*SOJoinResponse) UnmarshalVT

func (m *SOJoinResponse) UnmarshalVT(dAtA []byte) error

type SOKeyEpoch

type SOKeyEpoch struct {

	// Epoch is the epoch number (0-based, increments on rotation).
	Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"`
	// SeqnoStart is the first root seqno this key covers.
	SeqnoStart uint64 `protobuf:"varint,2,opt,name=seqno_start,json=seqnoStart,proto3" json:"seqnoStart,omitempty"`
	// SeqnoEnd is the last root seqno this key covers (0 = current/open).
	SeqnoEnd uint64 `protobuf:"varint,3,opt,name=seqno_end,json=seqnoEnd,proto3" json:"seqnoEnd,omitempty"`
	// Grants are the encrypted transform key grants for this epoch.
	Grants []*SOGrant `protobuf:"bytes,4,rep,name=grants,proto3" json:"grants,omitempty"`
	// contains filtered or unexported fields
}

SOKeyEpoch represents a key epoch with grants for that period.

func FindCoveringEpoch

func FindCoveringEpoch(epochs []*SOKeyEpoch, seqno uint64) *SOKeyEpoch

FindCoveringEpoch finds the key epoch that covers the given seqno. Returns nil if no epoch covers the seqno.

func (*SOKeyEpoch) CloneMessageVT

func (m *SOKeyEpoch) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SOKeyEpoch) CloneVT

func (m *SOKeyEpoch) CloneVT() *SOKeyEpoch

func (*SOKeyEpoch) EqualMessageVT

func (this *SOKeyEpoch) EqualMessageVT(thatMsg any) bool

func (*SOKeyEpoch) EqualVT

func (this *SOKeyEpoch) EqualVT(that *SOKeyEpoch) bool

func (*SOKeyEpoch) GetEpoch

func (x *SOKeyEpoch) GetEpoch() uint64

func (*SOKeyEpoch) GetGrants

func (x *SOKeyEpoch) GetGrants() []*SOGrant

func (*SOKeyEpoch) GetSeqnoEnd

func (x *SOKeyEpoch) GetSeqnoEnd() uint64

func (*SOKeyEpoch) GetSeqnoStart

func (x *SOKeyEpoch) GetSeqnoStart() uint64

func (*SOKeyEpoch) MarshalJSON

func (x *SOKeyEpoch) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SOKeyEpoch to JSON.

func (*SOKeyEpoch) MarshalProtoJSON

func (x *SOKeyEpoch) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SOKeyEpoch message to JSON.

func (*SOKeyEpoch) MarshalProtoText

func (x *SOKeyEpoch) MarshalProtoText() string

func (*SOKeyEpoch) MarshalToSizedBufferVT

func (m *SOKeyEpoch) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SOKeyEpoch) MarshalToVT

func (m *SOKeyEpoch) MarshalToVT(dAtA []byte) (int, error)

func (*SOKeyEpoch) MarshalVT

func (m *SOKeyEpoch) MarshalVT() (dAtA []byte, err error)

func (*SOKeyEpoch) ProtoMessage

func (*SOKeyEpoch) ProtoMessage()

func (*SOKeyEpoch) Reset

func (x *SOKeyEpoch) Reset()

func (*SOKeyEpoch) SizeVT

func (m *SOKeyEpoch) SizeVT() (n int)

func (*SOKeyEpoch) String

func (x *SOKeyEpoch) String() string

func (*SOKeyEpoch) UnmarshalJSON

func (x *SOKeyEpoch) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SOKeyEpoch from JSON.

func (*SOKeyEpoch) UnmarshalProtoJSON

func (x *SOKeyEpoch) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SOKeyEpoch message from JSON.

func (*SOKeyEpoch) UnmarshalVT

func (m *SOKeyEpoch) UnmarshalVT(dAtA []byte) error

type SOOperation

type SOOperation struct {

	// Inner is the encoded SOOperationInner object.
	Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"`
	// Signature is the signature of inner.
	// The signature public key must match the participant's peer_id.
	Signature *peer.Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
	// contains filtered or unexported fields
}

SOOperation represents an individual operation submitted by a participant.

func BuildSOOperation

func BuildSOOperation(
	sharedObjectID string,
	privKey crypto.PrivKey,
	opDataEnc []byte,
	opNonce uint64,
	opLocalID string,
) (*SOOperation, error)

BuildSOOperation constructs a new SOOperation for a writer or validator. The privKey must belong to a writer or validator participant. opDataEnc should be opData encoded with the root state transform.

func FilterResolvedOperations

func FilterResolvedOperations(
	ops []*SOOperation,
	accountNonces []*SOAccountNonce,
	acceptedOps []*SOOperationInner,
	rejections []*SOPeerOpRejections,
) []*SOOperation

FilterResolvedOperations removes pending ops already resolved by root account nonces, explicitly accepted operations, or recorded rejections. acceptedOps may be nil when the caller only needs root/rejection pruning.

func (*SOOperation) CloneMessageVT

func (m *SOOperation) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SOOperation) CloneVT

func (m *SOOperation) CloneVT() *SOOperation

func (*SOOperation) EqualMessageVT

func (this *SOOperation) EqualMessageVT(thatMsg any) bool

func (*SOOperation) EqualVT

func (this *SOOperation) EqualVT(that *SOOperation) bool

func (*SOOperation) GetInner

func (x *SOOperation) GetInner() []byte

func (*SOOperation) GetSignature

func (x *SOOperation) GetSignature() *peer.Signature

func (*SOOperation) MarshalJSON

func (x *SOOperation) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SOOperation to JSON.

func (*SOOperation) MarshalProtoJSON

func (x *SOOperation) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SOOperation message to JSON.

func (*SOOperation) MarshalProtoText

func (x *SOOperation) MarshalProtoText() string

func (*SOOperation) MarshalToSizedBufferVT

func (m *SOOperation) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SOOperation) MarshalToVT

func (m *SOOperation) MarshalToVT(dAtA []byte) (int, error)

func (*SOOperation) MarshalVT

func (m *SOOperation) MarshalVT() (dAtA []byte, err error)

func (*SOOperation) ProtoMessage

func (*SOOperation) ProtoMessage()

func (*SOOperation) Reset

func (x *SOOperation) Reset()

func (*SOOperation) SizeVT

func (m *SOOperation) SizeVT() (n int)

func (*SOOperation) String

func (x *SOOperation) String() string

func (*SOOperation) UnmarshalInner

func (op *SOOperation) UnmarshalInner() (*SOOperationInner, error)

UnmarshalInner unmarshals and verifies the SOOperationInner.

func (*SOOperation) UnmarshalJSON

func (x *SOOperation) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SOOperation from JSON.

func (*SOOperation) UnmarshalProtoJSON

func (x *SOOperation) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SOOperation message from JSON.

func (*SOOperation) UnmarshalVT

func (m *SOOperation) UnmarshalVT(dAtA []byte) error

func (*SOOperation) Validate

func (op *SOOperation) Validate() error

Validate performs cursory checks on the SOOperation.

func (*SOOperation) ValidateSignature

func (op *SOOperation) ValidateSignature(sharedObjectID string, participants []*SOParticipantConfig) error

ValidateSignature validates the signature on a SOOperation.

type SOOperationInner

type SOOperationInner struct {

	// PeerId is the identifier of the participant submitting the operation.
	PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peerId,omitempty"`
	// LocalId is the locally-assigned ulid for the operation.
	// Must be a valid ulid.
	// Must be lower-case.
	LocalId string `protobuf:"bytes,2,opt,name=local_id,json=localId,proto3" json:"localId,omitempty"`
	// Nonce is the nonce for the operation; must increment from the previous.
	Nonce uint64 `protobuf:"varint,3,opt,name=nonce,proto3" json:"nonce,omitempty"`
	// OpData is the operation data, transformed with the same transform config as root.
	OpData []byte `protobuf:"bytes,4,opt,name=op_data,json=opData,proto3" json:"opData,omitempty"`
	// contains filtered or unexported fields
}

SOOperationInner is the inner message of SOOperation.

func (*SOOperationInner) CloneMessageVT

func (m *SOOperationInner) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SOOperationInner) CloneVT

func (m *SOOperationInner) CloneVT() *SOOperationInner

func (*SOOperationInner) EqualMessageVT

func (this *SOOperationInner) EqualMessageVT(thatMsg any) bool

func (*SOOperationInner) EqualVT

func (this *SOOperationInner) EqualVT(that *SOOperationInner) bool

func (*SOOperationInner) GetLocalId

func (x *SOOperationInner) GetLocalId() string

func (*SOOperationInner) GetNonce

func (x *SOOperationInner) GetNonce() uint64

func (*SOOperationInner) GetOpData

func (x *SOOperationInner) GetOpData() []byte

func (*SOOperationInner) GetPeerId

func (x *SOOperationInner) GetPeerId() string

func (*SOOperationInner) MarshalJSON

func (x *SOOperationInner) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SOOperationInner to JSON.

func (*SOOperationInner) MarshalProtoJSON

func (x *SOOperationInner) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SOOperationInner message to JSON.

func (*SOOperationInner) MarshalProtoText

func (x *SOOperationInner) MarshalProtoText() string

func (*SOOperationInner) MarshalToSizedBufferVT

func (m *SOOperationInner) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SOOperationInner) MarshalToVT

func (m *SOOperationInner) MarshalToVT(dAtA []byte) (int, error)

func (*SOOperationInner) MarshalVT

func (m *SOOperationInner) MarshalVT() (dAtA []byte, err error)

func (*SOOperationInner) ParsePeerID

func (i *SOOperationInner) ParsePeerID() (peer.ID, error)

ParsePeerID parses the peer ID.

func (*SOOperationInner) ProtoMessage

func (*SOOperationInner) ProtoMessage()

func (*SOOperationInner) Reset

func (x *SOOperationInner) Reset()

func (*SOOperationInner) SizeVT

func (m *SOOperationInner) SizeVT() (n int)

func (*SOOperationInner) String

func (x *SOOperationInner) String() string

func (*SOOperationInner) UnmarshalJSON

func (x *SOOperationInner) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SOOperationInner from JSON.

func (*SOOperationInner) UnmarshalProtoJSON

func (x *SOOperationInner) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SOOperationInner message from JSON.

func (*SOOperationInner) UnmarshalVT

func (m *SOOperationInner) UnmarshalVT(dAtA []byte) error

func (*SOOperationInner) Validate

func (i *SOOperationInner) Validate() error

Validate performs cursory checks on the SOOperationInner.

type SOOperationRef

type SOOperationRef struct {

	// PeerId is the identifier of the participant submitting the operation.
	PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peerId,omitempty"`
	// Nonce is the nonce for the operation.
	Nonce uint64 `protobuf:"varint,2,opt,name=nonce,proto3" json:"nonce,omitempty"`
	// contains filtered or unexported fields
}

SOOperationRef is a reference to an operation that was queued.

func (*SOOperationRef) CloneMessageVT

func (m *SOOperationRef) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SOOperationRef) CloneVT

func (m *SOOperationRef) CloneVT() *SOOperationRef

func (*SOOperationRef) EqualMessageVT

func (this *SOOperationRef) EqualMessageVT(thatMsg any) bool

func (*SOOperationRef) EqualVT

func (this *SOOperationRef) EqualVT(that *SOOperationRef) bool

func (*SOOperationRef) GetNonce

func (x *SOOperationRef) GetNonce() uint64

func (*SOOperationRef) GetPeerId

func (x *SOOperationRef) GetPeerId() string

func (*SOOperationRef) MarshalJSON

func (x *SOOperationRef) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SOOperationRef to JSON.

func (*SOOperationRef) MarshalProtoJSON

func (x *SOOperationRef) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SOOperationRef message to JSON.

func (*SOOperationRef) MarshalProtoText

func (x *SOOperationRef) MarshalProtoText() string

func (*SOOperationRef) MarshalToSizedBufferVT

func (m *SOOperationRef) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SOOperationRef) MarshalToVT

func (m *SOOperationRef) MarshalToVT(dAtA []byte) (int, error)

func (*SOOperationRef) MarshalVT

func (m *SOOperationRef) MarshalVT() (dAtA []byte, err error)

func (*SOOperationRef) ParsePeerID

func (r *SOOperationRef) ParsePeerID() (peer.ID, error)

ParsePeerID parses the peer ID.

func (*SOOperationRef) ProtoMessage

func (*SOOperationRef) ProtoMessage()

func (*SOOperationRef) Reset

func (x *SOOperationRef) Reset()

func (*SOOperationRef) SizeVT

func (m *SOOperationRef) SizeVT() (n int)

func (*SOOperationRef) String

func (x *SOOperationRef) String() string

func (*SOOperationRef) UnmarshalJSON

func (x *SOOperationRef) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SOOperationRef from JSON.

func (*SOOperationRef) UnmarshalProtoJSON

func (x *SOOperationRef) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SOOperationRef message from JSON.

func (*SOOperationRef) UnmarshalVT

func (m *SOOperationRef) UnmarshalVT(dAtA []byte) error

func (*SOOperationRef) Validate

func (r *SOOperationRef) Validate() error

Validate validates the SOOperationRef.

type SOOperationRejection

type SOOperationRejection struct {

	// Inner is the encoded SOOperationRejectionInner object.
	Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"`
	// Signature is the signature of inner by the validator.
	// The pub key must match the peer id of a valid validator.
	Signature *peer.Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
	// contains filtered or unexported fields
}

SOOperationRejection represents the rejection of an operation by a validator. This tracks rejected operations until the participant acknowledges them.

func BuildSOOperationRejection

func BuildSOOperationRejection(
	privKey crypto.PrivKey,
	sharedObjectID string,
	submitterPeerID peer.ID,
	opNonce uint64,
	opLocalID string,
	errorDetails *SOOperationRejectionErrorDetails,
) (*SOOperationRejection, error)

BuildSOOperationRejection constructs a new SOOperationRejection. The privKey is used to sign the rejection. The sharedObjectID is used to build the signature context. The submitterPeerID is the peer ID of the operation submitter. The opNonce is the nonce of the rejected operation. The opLocalID is the local ID of the rejected operation, must match the original operation. The errorDetails are optional and may be nil.

func (*SOOperationRejection) CloneMessageVT

func (*SOOperationRejection) CloneVT

func (*SOOperationRejection) EqualMessageVT

func (this *SOOperationRejection) EqualMessageVT(thatMsg any) bool

func (*SOOperationRejection) EqualVT

func (this *SOOperationRejection) EqualVT(that *SOOperationRejection) bool

func (*SOOperationRejection) GetInner

func (x *SOOperationRejection) GetInner() []byte

func (*SOOperationRejection) GetSignature

func (x *SOOperationRejection) GetSignature() *peer.Signature

func (*SOOperationRejection) MarshalJSON

func (x *SOOperationRejection) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SOOperationRejection to JSON.

func (*SOOperationRejection) MarshalProtoJSON

func (x *SOOperationRejection) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SOOperationRejection message to JSON.

func (*SOOperationRejection) MarshalProtoText

func (x *SOOperationRejection) MarshalProtoText() string

func (*SOOperationRejection) MarshalToSizedBufferVT

func (m *SOOperationRejection) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SOOperationRejection) MarshalToVT

func (m *SOOperationRejection) MarshalToVT(dAtA []byte) (int, error)

func (*SOOperationRejection) MarshalVT

func (m *SOOperationRejection) MarshalVT() (dAtA []byte, err error)

func (*SOOperationRejection) ProtoMessage

func (*SOOperationRejection) ProtoMessage()

func (*SOOperationRejection) Reset

func (x *SOOperationRejection) Reset()

func (*SOOperationRejection) SizeVT

func (m *SOOperationRejection) SizeVT() (n int)

func (*SOOperationRejection) String

func (x *SOOperationRejection) String() string

func (*SOOperationRejection) UnmarshalInner

func (r *SOOperationRejection) UnmarshalInner() (*SOOperationRejectionInner, error)

UnmarshalInner unmarshals and verifies the SOOperationRejectionInner.

func (*SOOperationRejection) UnmarshalJSON

func (x *SOOperationRejection) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SOOperationRejection from JSON.

func (*SOOperationRejection) UnmarshalProtoJSON

func (x *SOOperationRejection) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SOOperationRejection message from JSON.

func (*SOOperationRejection) UnmarshalVT

func (m *SOOperationRejection) UnmarshalVT(dAtA []byte) error

func (*SOOperationRejection) Validate

func (r *SOOperationRejection) Validate() error

Validate performs cursory checks on the SOOperationRejection.

func (*SOOperationRejection) ValidateSignature

func (r *SOOperationRejection) ValidateSignature(sharedObjectID string, participants []*SOParticipantConfig) (*SOOperationRejectionInner, error)

ValidateSignature validates the signature on a SOOperationRejection.

type SOOperationRejectionErrorDetails

type SOOperationRejectionErrorDetails struct {

	// ErrorMsg is the error message.
	ErrorMsg string `protobuf:"bytes,1,opt,name=error_msg,json=errorMsg,proto3" json:"errorMsg,omitempty"`
	// contains filtered or unexported fields
}

SOOperationRejectionErrorDetails contains error details.

func (*SOOperationRejectionErrorDetails) CloneMessageVT

func (*SOOperationRejectionErrorDetails) CloneVT

func (*SOOperationRejectionErrorDetails) EqualMessageVT

func (this *SOOperationRejectionErrorDetails) EqualMessageVT(thatMsg any) bool

func (*SOOperationRejectionErrorDetails) EqualVT

func (*SOOperationRejectionErrorDetails) GetErrorMsg

func (x *SOOperationRejectionErrorDetails) GetErrorMsg() string

func (*SOOperationRejectionErrorDetails) MarshalJSON

func (x *SOOperationRejectionErrorDetails) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SOOperationRejectionErrorDetails to JSON.

func (*SOOperationRejectionErrorDetails) MarshalProtoJSON

func (x *SOOperationRejectionErrorDetails) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SOOperationRejectionErrorDetails message to JSON.

func (*SOOperationRejectionErrorDetails) MarshalProtoText

func (x *SOOperationRejectionErrorDetails) MarshalProtoText() string

func (*SOOperationRejectionErrorDetails) MarshalToSizedBufferVT

func (m *SOOperationRejectionErrorDetails) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SOOperationRejectionErrorDetails) MarshalToVT

func (m *SOOperationRejectionErrorDetails) MarshalToVT(dAtA []byte) (int, error)

func (*SOOperationRejectionErrorDetails) MarshalVT

func (m *SOOperationRejectionErrorDetails) MarshalVT() (dAtA []byte, err error)

func (*SOOperationRejectionErrorDetails) ProtoMessage

func (*SOOperationRejectionErrorDetails) ProtoMessage()

func (*SOOperationRejectionErrorDetails) Reset

func (*SOOperationRejectionErrorDetails) SizeVT

func (m *SOOperationRejectionErrorDetails) SizeVT() (n int)

func (*SOOperationRejectionErrorDetails) String

func (*SOOperationRejectionErrorDetails) UnmarshalJSON

func (x *SOOperationRejectionErrorDetails) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SOOperationRejectionErrorDetails from JSON.

func (*SOOperationRejectionErrorDetails) UnmarshalProtoJSON

func (x *SOOperationRejectionErrorDetails) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SOOperationRejectionErrorDetails message from JSON.

func (*SOOperationRejectionErrorDetails) UnmarshalVT

func (m *SOOperationRejectionErrorDetails) UnmarshalVT(dAtA []byte) error

type SOOperationRejectionInner

type SOOperationRejectionInner struct {

	// PeerId is the identifier of the participant that submitted the operation.
	PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peerId,omitempty"`
	// OpNonce is the nonce of the operation for the peer.
	OpNonce uint64 `protobuf:"varint,2,opt,name=op_nonce,json=opNonce,proto3" json:"opNonce,omitempty"`
	// LocalId is the locally-assigned ulid for the operation.
	// Must be a valid ulid.
	// Must be lower-case.
	LocalId string `protobuf:"bytes,3,opt,name=local_id,json=localId,proto3" json:"localId,omitempty"`
	// ErrorDetails contains details about the rejection encoded to the peer id.
	// May be empty if there are no details.
	ErrorDetails []byte `protobuf:"bytes,4,opt,name=error_details,json=errorDetails,proto3" json:"errorDetails,omitempty"`
	// contains filtered or unexported fields
}

SOOperationRejectionInner is the inner message of SOOperationRejection.

func (*SOOperationRejectionInner) CloneMessageVT

func (*SOOperationRejectionInner) CloneVT

func (*SOOperationRejectionInner) DecodeErrorDetails

func (i *SOOperationRejectionInner) DecodeErrorDetails(privKey crypto.PrivKey, sharedObjectID string, validatorPeerID peer.ID) (*SOOperationRejectionErrorDetails, error)

DecodeErrorDetails decodes the error details message.

If the field is empty, returns nil, nil

func (*SOOperationRejectionInner) EqualMessageVT

func (this *SOOperationRejectionInner) EqualMessageVT(thatMsg any) bool

func (*SOOperationRejectionInner) EqualVT

func (*SOOperationRejectionInner) GetErrorDetails

func (x *SOOperationRejectionInner) GetErrorDetails() []byte

func (*SOOperationRejectionInner) GetLocalId

func (x *SOOperationRejectionInner) GetLocalId() string

func (*SOOperationRejectionInner) GetOpNonce

func (x *SOOperationRejectionInner) GetOpNonce() uint64

func (*SOOperationRejectionInner) GetPeerId

func (x *SOOperationRejectionInner) GetPeerId() string

func (*SOOperationRejectionInner) MarshalJSON

func (x *SOOperationRejectionInner) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SOOperationRejectionInner to JSON.

func (*SOOperationRejectionInner) MarshalProtoJSON

func (x *SOOperationRejectionInner) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SOOperationRejectionInner message to JSON.

func (*SOOperationRejectionInner) MarshalProtoText

func (x *SOOperationRejectionInner) MarshalProtoText() string

func (*SOOperationRejectionInner) MarshalToSizedBufferVT

func (m *SOOperationRejectionInner) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SOOperationRejectionInner) MarshalToVT

func (m *SOOperationRejectionInner) MarshalToVT(dAtA []byte) (int, error)

func (*SOOperationRejectionInner) MarshalVT

func (m *SOOperationRejectionInner) MarshalVT() (dAtA []byte, err error)

func (*SOOperationRejectionInner) ParsePeerID

func (i *SOOperationRejectionInner) ParsePeerID() (peer.ID, error)

ParsePeerID parses the peer ID.

func (*SOOperationRejectionInner) ProtoMessage

func (*SOOperationRejectionInner) ProtoMessage()

func (*SOOperationRejectionInner) Reset

func (x *SOOperationRejectionInner) Reset()

func (*SOOperationRejectionInner) SizeVT

func (m *SOOperationRejectionInner) SizeVT() (n int)

func (*SOOperationRejectionInner) String

func (x *SOOperationRejectionInner) String() string

func (*SOOperationRejectionInner) UnmarshalJSON

func (x *SOOperationRejectionInner) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SOOperationRejectionInner from JSON.

func (*SOOperationRejectionInner) UnmarshalProtoJSON

func (x *SOOperationRejectionInner) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SOOperationRejectionInner message from JSON.

func (*SOOperationRejectionInner) UnmarshalVT

func (m *SOOperationRejectionInner) UnmarshalVT(dAtA []byte) error

func (*SOOperationRejectionInner) Validate

func (i *SOOperationRejectionInner) Validate() error

Validate performs cursory checks on the SOOperationRejectionInner.

type SOOperationResult

type SOOperationResult struct {

	// OpRef is the operation reference.
	OpRef *SOOperationRef `protobuf:"bytes,1,opt,name=op_ref,json=opRef,proto3" json:"opRef,omitempty"`
	// Body is the body of the result.
	//
	// Types that are assignable to Body:
	//
	//	*SOOperationResult_Success
	//	*SOOperationResult_ErrorDetails
	Body isSOOperationResult_Body `protobuf_oneof:"body"`
	// contains filtered or unexported fields
}

SOOperationResult is the result of applying an operation.

func BuildSOOperationResult

func BuildSOOperationResult(
	peerID string,
	nonce uint64,
	success bool,
	errorDetails *SOOperationRejectionErrorDetails,
) *SOOperationResult

BuildSOOperationResult constructs a new SOOperationResult. If success is false, errorDetails must be non-nil.

func (*SOOperationResult) CloneMessageVT

func (m *SOOperationResult) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SOOperationResult) CloneVT

func (m *SOOperationResult) CloneVT() *SOOperationResult

func (*SOOperationResult) EqualMessageVT

func (this *SOOperationResult) EqualMessageVT(thatMsg any) bool

func (*SOOperationResult) EqualVT

func (this *SOOperationResult) EqualVT(that *SOOperationResult) bool

func (*SOOperationResult) GetBody

func (m *SOOperationResult) GetBody() isSOOperationResult_Body

func (*SOOperationResult) GetErrorDetails

func (*SOOperationResult) GetOpRef

func (x *SOOperationResult) GetOpRef() *SOOperationRef

func (*SOOperationResult) GetSuccess

func (x *SOOperationResult) GetSuccess() bool

func (*SOOperationResult) MarshalJSON

func (x *SOOperationResult) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SOOperationResult to JSON.

func (*SOOperationResult) MarshalProtoJSON

func (x *SOOperationResult) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SOOperationResult message to JSON.

func (*SOOperationResult) MarshalProtoText

func (x *SOOperationResult) MarshalProtoText() string

func (*SOOperationResult) MarshalToSizedBufferVT

func (m *SOOperationResult) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SOOperationResult) MarshalToVT

func (m *SOOperationResult) MarshalToVT(dAtA []byte) (int, error)

func (*SOOperationResult) MarshalVT

func (m *SOOperationResult) MarshalVT() (dAtA []byte, err error)

func (*SOOperationResult) ProtoMessage

func (*SOOperationResult) ProtoMessage()

func (*SOOperationResult) Reset

func (x *SOOperationResult) Reset()

func (*SOOperationResult) SizeVT

func (m *SOOperationResult) SizeVT() (n int)

func (*SOOperationResult) String

func (x *SOOperationResult) String() string

func (*SOOperationResult) UnmarshalJSON

func (x *SOOperationResult) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SOOperationResult from JSON.

func (*SOOperationResult) UnmarshalProtoJSON

func (x *SOOperationResult) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SOOperationResult message from JSON.

func (*SOOperationResult) UnmarshalVT

func (m *SOOperationResult) UnmarshalVT(dAtA []byte) error

type SOOperationResult_ErrorDetails

type SOOperationResult_ErrorDetails struct {
	// ErrorDetails contains the rejection error details.
	ErrorDetails *SOOperationRejectionErrorDetails `protobuf:"bytes,3,opt,name=error_details,json=errorDetails,proto3,oneof"`
}

func (*SOOperationResult_ErrorDetails) CloneOneofVT

func (m *SOOperationResult_ErrorDetails) CloneOneofVT() isSOOperationResult_Body

func (*SOOperationResult_ErrorDetails) CloneVT

func (*SOOperationResult_ErrorDetails) EqualVT

func (this *SOOperationResult_ErrorDetails) EqualVT(thatIface isSOOperationResult_Body) bool

func (*SOOperationResult_ErrorDetails) MarshalToSizedBufferVT

func (m *SOOperationResult_ErrorDetails) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SOOperationResult_ErrorDetails) MarshalToVT

func (m *SOOperationResult_ErrorDetails) MarshalToVT(dAtA []byte) (int, error)

func (*SOOperationResult_ErrorDetails) SizeVT

func (m *SOOperationResult_ErrorDetails) SizeVT() (n int)

type SOOperationResult_Success

type SOOperationResult_Success struct {
	// Success indicates the op was successful.
	Success bool `protobuf:"varint,2,opt,name=success,proto3,oneof"`
}

func (*SOOperationResult_Success) CloneOneofVT

func (m *SOOperationResult_Success) CloneOneofVT() isSOOperationResult_Body

func (*SOOperationResult_Success) CloneVT

func (*SOOperationResult_Success) EqualVT

func (this *SOOperationResult_Success) EqualVT(thatIface isSOOperationResult_Body) bool

func (*SOOperationResult_Success) MarshalToSizedBufferVT

func (m *SOOperationResult_Success) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SOOperationResult_Success) MarshalToVT

func (m *SOOperationResult_Success) MarshalToVT(dAtA []byte) (int, error)

func (*SOOperationResult_Success) SizeVT

func (m *SOOperationResult_Success) SizeVT() (n int)

type SOParticipantConfig

type SOParticipantConfig struct {

	// PeerId is the string representation of this participant's peer id.
	PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peerId,omitempty"`
	// Role is the general role of the participant.
	//
	// - READER: can read the value of the shared object only.
	// - WRITER: can submit transactions to apply.
	// - VALIDATOR: can validate and apply transactions.
	Role SOParticipantRole `protobuf:"varint,2,opt,name=role,proto3" json:"role,omitempty"`
	// EntityId is the account ID of the entity that owns this participant's session.
	// Set when an owner adds a cloud participant. Empty for local-only participants.
	EntityId string `protobuf:"bytes,3,opt,name=entity_id,json=entityId,proto3" json:"entityId,omitempty"`
	// contains filtered or unexported fields
}

SOParticipantConfig contains a listing of an entity associated with a shared object. Each entity may only appear one time in the list.

func (*SOParticipantConfig) CloneMessageVT

func (*SOParticipantConfig) CloneVT

func (*SOParticipantConfig) EqualMessageVT

func (this *SOParticipantConfig) EqualMessageVT(thatMsg any) bool

func (*SOParticipantConfig) EqualVT

func (this *SOParticipantConfig) EqualVT(that *SOParticipantConfig) bool

func (*SOParticipantConfig) GetEntityId

func (x *SOParticipantConfig) GetEntityId() string

func (*SOParticipantConfig) GetPeerId

func (x *SOParticipantConfig) GetPeerId() string

func (*SOParticipantConfig) GetRole

func (*SOParticipantConfig) MarshalJSON

func (x *SOParticipantConfig) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SOParticipantConfig to JSON.

func (*SOParticipantConfig) MarshalProtoJSON

func (x *SOParticipantConfig) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SOParticipantConfig message to JSON.

func (*SOParticipantConfig) MarshalProtoText

func (x *SOParticipantConfig) MarshalProtoText() string

func (*SOParticipantConfig) MarshalToSizedBufferVT

func (m *SOParticipantConfig) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SOParticipantConfig) MarshalToVT

func (m *SOParticipantConfig) MarshalToVT(dAtA []byte) (int, error)

func (*SOParticipantConfig) MarshalVT

func (m *SOParticipantConfig) MarshalVT() (dAtA []byte, err error)

func (*SOParticipantConfig) ParsePeerID

func (p *SOParticipantConfig) ParsePeerID() (peer.ID, error)

ParsePeerID parses the participant peer ID.

func (*SOParticipantConfig) ProtoMessage

func (*SOParticipantConfig) ProtoMessage()

func (*SOParticipantConfig) Reset

func (x *SOParticipantConfig) Reset()

func (*SOParticipantConfig) SizeVT

func (m *SOParticipantConfig) SizeVT() (n int)

func (*SOParticipantConfig) String

func (x *SOParticipantConfig) String() string

func (*SOParticipantConfig) UnmarshalJSON

func (x *SOParticipantConfig) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SOParticipantConfig from JSON.

func (*SOParticipantConfig) UnmarshalProtoJSON

func (x *SOParticipantConfig) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SOParticipantConfig message from JSON.

func (*SOParticipantConfig) UnmarshalVT

func (m *SOParticipantConfig) UnmarshalVT(dAtA []byte) error

func (*SOParticipantConfig) Validate

func (p *SOParticipantConfig) Validate() error

Validate performs cursory checks on the SOParticipant.

type SOParticipantRole

type SOParticipantRole int32

SOParticipantRole defines the general role of a shared object participant. In order of least permissive to most permissive.

const (
	// SOParticipantRole_UNKNOWN is the zero / invalid / unknown type.
	SOParticipantRole_SOParticipantRole_UNKNOWN SOParticipantRole = 0
	// SOParticipantRole_READER can read the value of the shared object only.
	SOParticipantRole_SOParticipantRole_READER SOParticipantRole = 1
	// SOParticipantRole_WRITER can submit transactions to apply.
	SOParticipantRole_SOParticipantRole_WRITER SOParticipantRole = 2
	// SOParticipantRole_VALIDATOR can validate and apply transactions.
	SOParticipantRole_SOParticipantRole_VALIDATOR SOParticipantRole = 3
	// SOParticipantRole_OWNER can modify config and manage participants.
	SOParticipantRole_SOParticipantRole_OWNER SOParticipantRole = 4
)

func (SOParticipantRole) Enum

func (SOParticipantRole) MarshalJSON

func (x SOParticipantRole) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SOParticipantRole to JSON.

func (SOParticipantRole) MarshalProtoJSON

func (x SOParticipantRole) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SOParticipantRole to JSON.

func (SOParticipantRole) MarshalProtoText

func (x SOParticipantRole) MarshalProtoText() string

func (SOParticipantRole) MarshalText

func (x SOParticipantRole) MarshalText() ([]byte, error)

MarshalText marshals the SOParticipantRole to text.

func (SOParticipantRole) String

func (x SOParticipantRole) String() string

func (*SOParticipantRole) UnmarshalJSON

func (x *SOParticipantRole) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SOParticipantRole from JSON.

func (*SOParticipantRole) UnmarshalProtoJSON

func (x *SOParticipantRole) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SOParticipantRole from JSON.

func (*SOParticipantRole) UnmarshalText

func (x *SOParticipantRole) UnmarshalText(b []byte) error

UnmarshalText unmarshals the SOParticipantRole from text.

type SOPeerOpRejections

type SOPeerOpRejections struct {

	// PeerId is the identifier of the participant.
	PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peerId,omitempty"`
	// Rejections is the list of rejections for this peer.
	Rejections []*SOOperationRejection `protobuf:"bytes,2,rep,name=rejections,proto3" json:"rejections,omitempty"`
	// contains filtered or unexported fields
}

SOPeerOpRejections contains all rejections for a specific peer.

func (*SOPeerOpRejections) CloneMessageVT

func (m *SOPeerOpRejections) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SOPeerOpRejections) CloneVT

func (m *SOPeerOpRejections) CloneVT() *SOPeerOpRejections

func (*SOPeerOpRejections) EqualMessageVT

func (this *SOPeerOpRejections) EqualMessageVT(thatMsg any) bool

func (*SOPeerOpRejections) EqualVT

func (this *SOPeerOpRejections) EqualVT(that *SOPeerOpRejections) bool

func (*SOPeerOpRejections) GetPeerId

func (x *SOPeerOpRejections) GetPeerId() string

func (*SOPeerOpRejections) GetRejections

func (x *SOPeerOpRejections) GetRejections() []*SOOperationRejection

func (*SOPeerOpRejections) MarshalJSON

func (x *SOPeerOpRejections) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SOPeerOpRejections to JSON.

func (*SOPeerOpRejections) MarshalProtoJSON

func (x *SOPeerOpRejections) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SOPeerOpRejections message to JSON.

func (*SOPeerOpRejections) MarshalProtoText

func (x *SOPeerOpRejections) MarshalProtoText() string

func (*SOPeerOpRejections) MarshalToSizedBufferVT

func (m *SOPeerOpRejections) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SOPeerOpRejections) MarshalToVT

func (m *SOPeerOpRejections) MarshalToVT(dAtA []byte) (int, error)

func (*SOPeerOpRejections) MarshalVT

func (m *SOPeerOpRejections) MarshalVT() (dAtA []byte, err error)

func (*SOPeerOpRejections) ParsePeerID

func (r *SOPeerOpRejections) ParsePeerID() (peer.ID, error)

ParsePeerID parses the peer ID for the SOPeerOpRejections.

func (*SOPeerOpRejections) ProtoMessage

func (*SOPeerOpRejections) ProtoMessage()

func (*SOPeerOpRejections) Reset

func (x *SOPeerOpRejections) Reset()

func (*SOPeerOpRejections) SizeVT

func (m *SOPeerOpRejections) SizeVT() (n int)

func (*SOPeerOpRejections) String

func (x *SOPeerOpRejections) String() string

func (*SOPeerOpRejections) UnmarshalJSON

func (x *SOPeerOpRejections) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SOPeerOpRejections from JSON.

func (*SOPeerOpRejections) UnmarshalProtoJSON

func (x *SOPeerOpRejections) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SOPeerOpRejections message from JSON.

func (*SOPeerOpRejections) UnmarshalVT

func (m *SOPeerOpRejections) UnmarshalVT(dAtA []byte) error

func (*SOPeerOpRejections) Validate

func (r *SOPeerOpRejections) Validate() error

Validate performs cursory checks on the SOPeerOpRejections.

type SORevocationInfo

type SORevocationInfo struct {

	// Reason is the reason for the revocation.
	Reason SORevocationReason `protobuf:"varint,1,opt,name=reason,proto3" json:"reason,omitempty"`
	// Timestamp is when the revocation occurred.
	Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// Nonce is a unique value to prevent replay of revocation entries.
	Nonce uint64 `protobuf:"varint,3,opt,name=nonce,proto3" json:"nonce,omitempty"`
	// contains filtered or unexported fields
}

SORevocationInfo contains metadata about why a participant was removed.

func (*SORevocationInfo) CloneMessageVT

func (m *SORevocationInfo) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SORevocationInfo) CloneVT

func (m *SORevocationInfo) CloneVT() *SORevocationInfo

func (*SORevocationInfo) EqualMessageVT

func (this *SORevocationInfo) EqualMessageVT(thatMsg any) bool

func (*SORevocationInfo) EqualVT

func (this *SORevocationInfo) EqualVT(that *SORevocationInfo) bool

func (*SORevocationInfo) GetNonce

func (x *SORevocationInfo) GetNonce() uint64

func (*SORevocationInfo) GetReason

func (x *SORevocationInfo) GetReason() SORevocationReason

func (*SORevocationInfo) GetTimestamp

func (x *SORevocationInfo) GetTimestamp() *timestamppb.Timestamp

func (*SORevocationInfo) MarshalJSON

func (x *SORevocationInfo) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SORevocationInfo to JSON.

func (*SORevocationInfo) MarshalProtoJSON

func (x *SORevocationInfo) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SORevocationInfo message to JSON.

func (*SORevocationInfo) MarshalProtoText

func (x *SORevocationInfo) MarshalProtoText() string

func (*SORevocationInfo) MarshalToSizedBufferVT

func (m *SORevocationInfo) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SORevocationInfo) MarshalToVT

func (m *SORevocationInfo) MarshalToVT(dAtA []byte) (int, error)

func (*SORevocationInfo) MarshalVT

func (m *SORevocationInfo) MarshalVT() (dAtA []byte, err error)

func (*SORevocationInfo) ProtoMessage

func (*SORevocationInfo) ProtoMessage()

func (*SORevocationInfo) Reset

func (x *SORevocationInfo) Reset()

func (*SORevocationInfo) SizeVT

func (m *SORevocationInfo) SizeVT() (n int)

func (*SORevocationInfo) String

func (x *SORevocationInfo) String() string

func (*SORevocationInfo) UnmarshalJSON

func (x *SORevocationInfo) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SORevocationInfo from JSON.

func (*SORevocationInfo) UnmarshalProtoJSON

func (x *SORevocationInfo) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SORevocationInfo message from JSON.

func (*SORevocationInfo) UnmarshalVT

func (m *SORevocationInfo) UnmarshalVT(dAtA []byte) error

type SORevocationReason

type SORevocationReason int32

SORevocationReason describes why a participant was removed.

const (
	// SO_REVOCATION_REASON_UNKNOWN is the zero value.
	SORevocationReason_SO_REVOCATION_REASON_UNKNOWN SORevocationReason = 0
	// SO_REVOCATION_REASON_SESSION_REVOKED indicates the participant's session was revoked.
	SORevocationReason_SO_REVOCATION_REASON_SESSION_REVOKED SORevocationReason = 1
	// SO_REVOCATION_REASON_ORG_REMOVED indicates the participant was removed from the org.
	SORevocationReason_SO_REVOCATION_REASON_ORG_REMOVED SORevocationReason = 2
	// SO_REVOCATION_REASON_OWNER_REMOVED indicates the owner manually removed the participant.
	SORevocationReason_SO_REVOCATION_REASON_OWNER_REMOVED SORevocationReason = 3
	// SO_REVOCATION_REASON_INVITE_REVOKED indicates the participant's invite was revoked.
	SORevocationReason_SO_REVOCATION_REASON_INVITE_REVOKED SORevocationReason = 4
)

func (SORevocationReason) Enum

func (SORevocationReason) MarshalJSON

func (x SORevocationReason) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SORevocationReason to JSON.

func (SORevocationReason) MarshalProtoJSON

func (x SORevocationReason) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SORevocationReason to JSON.

func (SORevocationReason) MarshalProtoText

func (x SORevocationReason) MarshalProtoText() string

func (SORevocationReason) MarshalText

func (x SORevocationReason) MarshalText() ([]byte, error)

MarshalText marshals the SORevocationReason to text.

func (SORevocationReason) String

func (x SORevocationReason) String() string

func (*SORevocationReason) UnmarshalJSON

func (x *SORevocationReason) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SORevocationReason from JSON.

func (*SORevocationReason) UnmarshalProtoJSON

func (x *SORevocationReason) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SORevocationReason from JSON.

func (*SORevocationReason) UnmarshalText

func (x *SORevocationReason) UnmarshalText(b []byte) error

UnmarshalText unmarshals the SORevocationReason from text.

type SORoot

type SORoot struct {

	// Inner is the encoded and encrypted SORootInner.
	Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"`
	// InnerSeqno is the sequence number of the SORootInner.
	// Must match inner.seqno.
	InnerSeqno uint64 `protobuf:"varint,2,opt,name=inner_seqno,json=innerSeqno,proto3" json:"innerSeqno,omitempty"`
	// AccountNonces contains the current nonce for each account.
	// The accounts are sorted lexicographically by peer_id.
	AccountNonces []*SOAccountNonce `protobuf:"bytes,3,rep,name=account_nonces,json=accountNonces,proto3" json:"accountNonces,omitempty"`
	// ValidatorSignatures contains the set of signatures of []byte(inner + account_nonces).
	// The signature public key must match a peer id of a validator.
	ValidatorSignatures []*peer.Signature `protobuf:"bytes,4,rep,name=validator_signatures,json=validatorSignatures,proto3" json:"validatorSignatures,omitempty"`
	// contains filtered or unexported fields
}

SORoot is the signed root state on a SharedObject.

func (*SORoot) ApplyUpdatedState

func (r *SORoot) ApplyUpdatedState(privKey crypto.PrivKey, sharedObjectID string, prevSeqno uint64, hashType hash.HashType, innerData []byte) error

ApplyUpdatedState applies an updated state to the SORoot. Asserts that the previous (current) seqno is prevSeqno. Signs the updated state. Updates the SORoot in-place. innerData should be the transformed marshaled inner data object.

func (*SORoot) BuildSignatureData

func (r *SORoot) BuildSignatureData() ([]byte, error)

BuildSignatureData builds the signature data that includes both inner and account nonces

func (*SORoot) CloneMessageVT

func (m *SORoot) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SORoot) CloneVT

func (m *SORoot) CloneVT() *SORoot

func (*SORoot) EqualMessageVT

func (this *SORoot) EqualMessageVT(thatMsg any) bool

func (*SORoot) EqualVT

func (this *SORoot) EqualVT(that *SORoot) bool

func (*SORoot) GetAccountNonces

func (x *SORoot) GetAccountNonces() []*SOAccountNonce

func (*SORoot) GetInner

func (x *SORoot) GetInner() []byte

func (*SORoot) GetInnerSeqno

func (x *SORoot) GetInnerSeqno() uint64

func (*SORoot) GetValidatorSignatures

func (x *SORoot) GetValidatorSignatures() []*peer.Signature

func (*SORoot) MarshalJSON

func (x *SORoot) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SORoot to JSON.

func (*SORoot) MarshalProtoJSON

func (x *SORoot) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SORoot message to JSON.

func (*SORoot) MarshalProtoText

func (x *SORoot) MarshalProtoText() string

func (*SORoot) MarshalToSizedBufferVT

func (m *SORoot) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SORoot) MarshalToVT

func (m *SORoot) MarshalToVT(dAtA []byte) (int, error)

func (*SORoot) MarshalVT

func (m *SORoot) MarshalVT() (dAtA []byte, err error)

func (*SORoot) ProtoMessage

func (*SORoot) ProtoMessage()

func (*SORoot) Reset

func (x *SORoot) Reset()

func (*SORoot) SignInnerData

func (r *SORoot) SignInnerData(privKey crypto.PrivKey, sharedObjectID string, seqno uint64, hashType hash.HashType) error

SignInnerData signs the inner data with a validator privKey. If the privKey was already used to sign the data, does nothing. seqno asserts that r.InnerSeqno matches the given value.

func (*SORoot) SizeVT

func (m *SORoot) SizeVT() (n int)

func (*SORoot) String

func (x *SORoot) String() string

func (*SORoot) UnmarshalJSON

func (x *SORoot) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SORoot from JSON.

func (*SORoot) UnmarshalProtoJSON

func (x *SORoot) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SORoot message from JSON.

func (*SORoot) UnmarshalVT

func (m *SORoot) UnmarshalVT(dAtA []byte) error

func (*SORoot) Validate

func (r *SORoot) Validate() error

func (*SORoot) ValidateSignatures

func (r *SORoot) ValidateSignatures(sharedObjectID string, participants []*SOParticipantConfig) (int, error)

ValidateSignatures validates the signatures on a SORoot. Returns the number of valid validator signatures and any error.

type SORootInner

type SORootInner struct {

	// Seqno is the sequence number of the root state.
	Seqno uint64 `protobuf:"varint,1,opt,name=seqno,proto3" json:"seqno,omitempty"`
	// StateData is the root state data for the shared object.
	StateData []byte `protobuf:"bytes,2,opt,name=state_data,json=stateData,proto3" json:"stateData,omitempty"`
	// contains filtered or unexported fields
}

SORootInner is the inner signed message on SORoot.

func (*SORootInner) CloneMessageVT

func (m *SORootInner) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SORootInner) CloneVT

func (m *SORootInner) CloneVT() *SORootInner

func (*SORootInner) EqualMessageVT

func (this *SORootInner) EqualMessageVT(thatMsg any) bool

func (*SORootInner) EqualVT

func (this *SORootInner) EqualVT(that *SORootInner) bool

func (*SORootInner) GetSeqno

func (x *SORootInner) GetSeqno() uint64

func (*SORootInner) GetStateData

func (x *SORootInner) GetStateData() []byte

func (*SORootInner) MarshalJSON

func (x *SORootInner) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SORootInner to JSON.

func (*SORootInner) MarshalProtoJSON

func (x *SORootInner) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SORootInner message to JSON.

func (*SORootInner) MarshalProtoText

func (x *SORootInner) MarshalProtoText() string

func (*SORootInner) MarshalToSizedBufferVT

func (m *SORootInner) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SORootInner) MarshalToVT

func (m *SORootInner) MarshalToVT(dAtA []byte) (int, error)

func (*SORootInner) MarshalVT

func (m *SORootInner) MarshalVT() (dAtA []byte, err error)

func (*SORootInner) ProtoMessage

func (*SORootInner) ProtoMessage()

func (*SORootInner) Reset

func (x *SORootInner) Reset()

func (*SORootInner) SizeVT

func (m *SORootInner) SizeVT() (n int)

func (*SORootInner) String

func (x *SORootInner) String() string

func (*SORootInner) UnmarshalJSON

func (x *SORootInner) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SORootInner from JSON.

func (*SORootInner) UnmarshalProtoJSON

func (x *SORootInner) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SORootInner message from JSON.

func (*SORootInner) UnmarshalVT

func (m *SORootInner) UnmarshalVT(dAtA []byte) error

func (*SORootInner) Validate

func (r *SORootInner) Validate() error

Validate performs cursory checks on the SORootInner.

type SOState

type SOState struct {

	// Config is the shared object config.
	Config *SharedObjectConfig `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
	// Root is the current shared object root state.
	Root *SORoot `protobuf:"bytes,2,opt,name=root,proto3" json:"root,omitempty"`
	// RootGrants are grants to each of the participants.
	// Each grant contains the transform config for the SORoot.
	// Each grant must be signed by one of the validators.
	// Each grant must be signed with the correct shared object id.
	RootGrants []*SOGrant `protobuf:"bytes,3,rep,name=root_grants,json=rootGrants,proto3" json:"rootGrants,omitempty"`
	// Ops are the list of pending operations.
	// Validators can choose how many ops to apply.
	// Each op must have a unique (peer_id, nonce) pair.
	Ops []*SOOperation `protobuf:"bytes,4,rep,name=ops,proto3" json:"ops,omitempty"`
	// OpRejections contains the rejections of operations by validators for each peer.
	// These are kept until the participant acknowledges them.
	// The list is sorted by peer_id.
	OpRejections []*SOPeerOpRejections `protobuf:"bytes,5,rep,name=op_rejections,json=opRejections,proto3" json:"opRejections,omitempty"`
	// QueuedAccountNonces tracks the highest queued nonce for each account.
	// These nonces are not signed and are only used for local state tracking.
	// The accounts are sorted lexicographically by peer_id.
	QueuedAccountNonces []*SOAccountNonce `protobuf:"bytes,6,rep,name=queued_account_nonces,json=queuedAccountNonces,proto3" json:"queuedAccountNonces,omitempty"`
	// Invites is the list of pending invites on this shared object.
	// Stored in plaintext so both providers and cloud can verify invite validity.
	Invites []*SOInvite `protobuf:"bytes,7,rep,name=invites,proto3" json:"invites,omitempty"`
	// contains filtered or unexported fields
}

SOState contains the state of the shared object. Some implementations may drop or obscure some fields for some peers.

func UnmarshalSOState

func UnmarshalSOState(ctx context.Context, bcs *block.Cursor) (*SOState, error)

UnmarshalSOState unmarshals a SOState from a block cursor.

func (*SOState) ClearOperationResult

func (s *SOState) ClearOperationResult(sharedObjectID string, clearOp *SOClearOperationResult) error

ClearOperationResult clears a rejected operation result from the state. Verifies the clear operation result signature and that the operation being cleared was submitted by the same peer that signed the clear request.

func (*SOState) CloneMessageVT

func (m *SOState) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SOState) CloneVT

func (m *SOState) CloneVT() *SOState

func (*SOState) EqualMessageVT

func (this *SOState) EqualMessageVT(thatMsg any) bool

func (*SOState) EqualVT

func (this *SOState) EqualVT(that *SOState) bool

func (*SOState) GetConfig

func (x *SOState) GetConfig() *SharedObjectConfig

func (*SOState) GetInvites

func (x *SOState) GetInvites() []*SOInvite

func (*SOState) GetNextAccountNonce

func (s *SOState) GetNextAccountNonce(peerID string) uint64

GetNextAccountNonce determines the next nonce for an account.

func (*SOState) GetOpRejections

func (x *SOState) GetOpRejections() []*SOPeerOpRejections

func (*SOState) GetOperationStatus

func (s *SOState) GetOperationStatus(peerID, localID string) (*SOOperation, *SOOperationRejection, error)

GetOperationStatus returns the status of the given operation.

Returns the matching SOOperation if the operation is queued. Returns the matching SOOperationRejection if the operation is rejected. Returns nil, nil, nil if not found.

func (*SOState) GetOps

func (x *SOState) GetOps() []*SOOperation

func (*SOState) GetQueuedAccountNonces

func (x *SOState) GetQueuedAccountNonces() []*SOAccountNonce

func (*SOState) GetRoot

func (x *SOState) GetRoot() *SORoot

func (*SOState) GetRootGrants

func (x *SOState) GetRootGrants() []*SOGrant

func (*SOState) MarshalBlock

func (s *SOState) MarshalBlock() ([]byte, error)

MarshalBlock marshals the block to binary. This is the initial step of marshaling, before transformations.

func (*SOState) MarshalJSON

func (x *SOState) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SOState to JSON.

func (*SOState) MarshalProtoJSON

func (x *SOState) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SOState message to JSON.

func (*SOState) MarshalProtoText

func (x *SOState) MarshalProtoText() string

func (*SOState) MarshalToSizedBufferVT

func (m *SOState) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SOState) MarshalToVT

func (m *SOState) MarshalToVT(dAtA []byte) (int, error)

func (*SOState) MarshalVT

func (m *SOState) MarshalVT() (dAtA []byte, err error)

func (*SOState) ProtoMessage

func (*SOState) ProtoMessage()

func (*SOState) QueueOperation

func (s *SOState) QueueOperation(sharedObjectID string, op *SOOperation) error

QueueOperation queues an operation for a writer or validator. Returns an error if the operation cannot be queued or if the nonce doesn't match the expected value.

func (*SOState) Reset

func (x *SOState) Reset()

func (*SOState) SizeVT

func (m *SOState) SizeVT() (n int)

func (*SOState) String

func (x *SOState) String() string

func (*SOState) UnmarshalBlock

func (s *SOState) UnmarshalBlock(data []byte) error

UnmarshalBlock unmarshals the block to the object. This is the final step of decoding, after transformations.

func (*SOState) UnmarshalJSON

func (x *SOState) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SOState from JSON.

func (*SOState) UnmarshalProtoJSON

func (x *SOState) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SOState message from JSON.

func (*SOState) UnmarshalVT

func (m *SOState) UnmarshalVT(dAtA []byte) error

func (*SOState) UpdateRootState

func (s *SOState) UpdateRootState(
	sharedObjectID string,
	nextRootState *SORoot,
	enforceValidatorPeerID string,
	rejectedOps []*SOOperationRejection,
	acceptedOps []*SOOperation,
) error

UpdateRootState updates the root state of a SOState.

Applies the changes to the passed SOState. If an error is returned the SOState should be considered invalid. If enforceValidatorPeerID is non-empty, ensures the given validator is in the set of signatures.

func (*SOState) Validate

func (s *SOState) Validate(sharedObjectID string) error

Validate validates the SOState.

type SOStateLock

type SOStateLock interface {
	// GetSOState returns the SOState as of when the lock was acquired.
	GetSOState() *SOState

	// WriteSOState writes an updated SOState.
	// Returns an error if the lock was released already.
	// Only the locked handle should be able to write.
	WriteSOState(ctx context.Context, state *SOState) error

	// Release releases the lock.
	Release()
}

SOStateLock is a lock handle to a SOState.

func NewSOStateLock

func NewSOStateLock(
	initialState *SOState,
	writeFn func(ctx context.Context, state *SOState) error,
	release func(),
) SOStateLock

NewSOStateLock constructs a SOStateLock with an initial value and callbacks.

type SOStateLockFunc

type SOStateLockFunc = func(ctx context.Context, sharedObjectID string) (SOStateLock, error)

SOStateLockFunc is a function to lock and load the SOState.

type SOStateParticipantHandle

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

SOStateParticipantHandle implements SharedObjectStateSnapshot backed by a SOState plus a few extra functions.

func NewSOStateParticipantHandle

func NewSOStateParticipantHandle(
	le *logrus.Entry,
	sfs *block_transform.StepFactorySet,
	sharedObjectID string,
	state *SOState,
	privKey crypto.PrivKey,
	localPeerID peer.ID,
) *SOStateParticipantHandle

NewSOStateParticipantHandle constructs a SOStateParticipantHandle from a SOState and private key.

func (*SOStateParticipantHandle) GetOpQueue

GetOpQueue returns the operation queue for our participant. uses the peer identity from the SharedObject.

func (*SOStateParticipantHandle) GetOpRejections

GetOpRejections returns any operation rejections for our participant along with their decoded error details. uses the peer identity from the SharedObject. The error details slice corresponds 1:1 with the rejections slice. If a rejection has no error details, the corresponding entry will be nil.

func (*SOStateParticipantHandle) GetParticipantConfig

func (s *SOStateParticipantHandle) GetParticipantConfig(ctx context.Context) (*SOParticipantConfig, error)

GetParticipantConfig returns the participant record for our participant. uses the peer identity from the SharedObject. returns ErrNotParticipant if the local peer is not a participant.

func (*SOStateParticipantHandle) GetRootInner

func (s *SOStateParticipantHandle) GetRootInner(ctx context.Context) (*SORootInner, error)

GetRootInner attempts to decode the current SORootInner and return it. uses the peer identity from the SharedObject to decode.

func (*SOStateParticipantHandle) GetTransformInfo

func (s *SOStateParticipantHandle) GetTransformInfo(ctx context.Context) (*TransformInfo, error)

GetTransformInfo implements SharedObjectStateSnapshot.GetTransformInfo.

func (*SOStateParticipantHandle) GetTransformer

GetTransformer implements SharedObjectStateSnapshot.GetTransformer

func (*SOStateParticipantHandle) ProcessOperations

ProcessOperations implements SharedObjectStateSnapshot.ProcessOperations

type SOStateWatchFunc

type SOStateWatchFunc = func(ctx context.Context, sharedObjectID string, released func()) (ccontainer.Watchable[*SOState], func(), error)

SOStateWatchFunc is a function to watch the SOState for changes.

type SharedObject

type SharedObject interface {
	// GetBus returns the bus used by the session.
	GetBus() bus.Bus

	// GetPeerID returns the peer ID attached to this SharedObject handle.
	GetPeerID() peer.ID

	// GetSharedObjectID returns the shared object id.
	GetSharedObjectID() string

	// GetBlockStore returns the block store mounted along with the SharedObject.
	GetBlockStore() bstore.BlockStore

	// AccessLocalStateStore accesses a kvtx ops for a local state store with the given ID.
	// This state store is stored along with the local SharedObject state.
	AccessLocalStateStore(ctx context.Context, storeID string, released func()) (kvtx.Store, func(), error)

	// GetSharedObjectState returns an snapshot of the shared object state.
	GetSharedObjectState(ctx context.Context) (SharedObjectStateSnapshot, error)

	// AccessSharedObjectState adds a reference to the state and returns the state container.
	// Returns a release function. Accepts a function that is called if the Watchable becomes invalid.
	AccessSharedObjectState(ctx context.Context, released func()) (ccontainer.Watchable[SharedObjectStateSnapshot], func(), error)

	// QueueOperation applies an operation to the shared object op queue.
	// Returns after the operation is applied to the local queue.
	// Returns the local operation id.
	QueueOperation(ctx context.Context, op []byte) (string, error)

	// WaitOperation waits for the operation to be confirmed or rejected by the provider.
	// Returns the current state nonce (greater than or equal to the nonce when the op was applied).
	// After ClearOperation has been called, this will return success even for failed ops!
	// If the operation was rejected, returns 0, true, error.
	// Any other error returns 0, false, error
	WaitOperation(ctx context.Context, localID string) (uint64, bool, error)

	// ClearOperationResult clears the operation state.
	// No-op if the operation was successfully applied or ClearOperationResult was already called.
	// Be sure to call this after checking WaitOperation (not before).
	ClearOperationResult(ctx context.Context, localID string) error

	// ProcessOperations processes operations as a validator.
	// The ops should be processed in the order they are provided.
	// The results must be a subset of ops (but does not need to have all ops).
	//
	// If watch is set, waits for ops to be queued, then calls cb. Does not return.
	// If watch is unset, if there are no available ops, returns immediately.
	//
	// cb is called with the state snapshot and the decoded inner state.
	// If rawNextStateData is nil, no changes will be applied to the state (no-op).
	ProcessOperations(ctx context.Context, watch bool, cb ProcessOpsFunc) error
}

SharedObject is the shared object handle interface.

This is the interface exposed by the provider on the "client side."

func ExMountSharedObject

func ExMountSharedObject(
	ctx context.Context,
	b bus.Bus,
	ref *SharedObjectRef,
	returnIfIdle bool,
	valDisposeCb func(),
) (SharedObject, directive.Reference, error)

ExMountSharedObject executes a lookup for a single provider on the bus.

If returnIfIdle is set, returns when the directive becomes idle.

type SharedObjectConfig

type SharedObjectConfig struct {

	// Participants is the list of shared object participants.
	Participants []*SOParticipantConfig `protobuf:"bytes,1,rep,name=participants,proto3" json:"participants,omitempty"`
	// ConsensusMode is the consensus mechanism for validating root state updates.
	// Default (zero value) is SINGLE_VALIDATOR.
	ConsensusMode SOConsensusMode `protobuf:"varint,2,opt,name=consensus_mode,json=consensusMode,proto3" json:"consensusMode,omitempty"`
	// ConfigChainHash is the hash of the latest SOConfigChange entry.
	ConfigChainHash []byte `protobuf:"bytes,10,opt,name=config_chain_hash,json=configChainHash,proto3" json:"configChainHash,omitempty"`
	// ConfigChainSeqno is the sequence number of the latest SOConfigChange entry.
	// The next entry must have config_seqno == config_chain_seqno + 1.
	// Zero means no config changes have been applied yet (genesis state).
	ConfigChainSeqno uint64 `protobuf:"varint,11,opt,name=config_chain_seqno,json=configChainSeqno,proto3" json:"configChainSeqno,omitempty"`
	// contains filtered or unexported fields
}

SharedObjectConfig configures the SharedObject.

func (*SharedObjectConfig) CloneMessageVT

func (m *SharedObjectConfig) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SharedObjectConfig) CloneVT

func (m *SharedObjectConfig) CloneVT() *SharedObjectConfig

func (*SharedObjectConfig) EqualMessageVT

func (this *SharedObjectConfig) EqualMessageVT(thatMsg any) bool

func (*SharedObjectConfig) EqualVT

func (this *SharedObjectConfig) EqualVT(that *SharedObjectConfig) bool

func (*SharedObjectConfig) GetConfigChainHash

func (x *SharedObjectConfig) GetConfigChainHash() []byte

func (*SharedObjectConfig) GetConfigChainSeqno

func (x *SharedObjectConfig) GetConfigChainSeqno() uint64

func (*SharedObjectConfig) GetConsensusMode

func (x *SharedObjectConfig) GetConsensusMode() SOConsensusMode

func (*SharedObjectConfig) GetParticipants

func (x *SharedObjectConfig) GetParticipants() []*SOParticipantConfig

func (*SharedObjectConfig) MarshalJSON

func (x *SharedObjectConfig) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SharedObjectConfig to JSON.

func (*SharedObjectConfig) MarshalProtoJSON

func (x *SharedObjectConfig) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SharedObjectConfig message to JSON.

func (*SharedObjectConfig) MarshalProtoText

func (x *SharedObjectConfig) MarshalProtoText() string

func (*SharedObjectConfig) MarshalToSizedBufferVT

func (m *SharedObjectConfig) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SharedObjectConfig) MarshalToVT

func (m *SharedObjectConfig) MarshalToVT(dAtA []byte) (int, error)

func (*SharedObjectConfig) MarshalVT

func (m *SharedObjectConfig) MarshalVT() (dAtA []byte, err error)

func (*SharedObjectConfig) ProtoMessage

func (*SharedObjectConfig) ProtoMessage()

func (*SharedObjectConfig) Reset

func (x *SharedObjectConfig) Reset()

func (*SharedObjectConfig) SizeVT

func (m *SharedObjectConfig) SizeVT() (n int)

func (*SharedObjectConfig) String

func (x *SharedObjectConfig) String() string

func (*SharedObjectConfig) UnmarshalJSON

func (x *SharedObjectConfig) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SharedObjectConfig from JSON.

func (*SharedObjectConfig) UnmarshalProtoJSON

func (x *SharedObjectConfig) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SharedObjectConfig message from JSON.

func (*SharedObjectConfig) UnmarshalVT

func (m *SharedObjectConfig) UnmarshalVT(dAtA []byte) error

func (*SharedObjectConfig) Validate

func (c *SharedObjectConfig) Validate() error

Validate checks if the SharedObjectConfig is valid.

type SharedObjectHealth

type SharedObjectHealth struct {

	// Status is the lifecycle status for the SharedObject.
	Status SharedObjectHealthStatus `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"`
	// Layer identifies whether the issue is on the SharedObject or body layer.
	Layer SharedObjectHealthLayer `protobuf:"varint,2,opt,name=layer,proto3" json:"layer,omitempty"`
	// CommonReason identifies a stable cross-provider reason when known.
	CommonReason SharedObjectHealthCommonReason `protobuf:"varint,3,opt,name=common_reason,json=commonReason,proto3" json:"commonReason,omitempty"`
	// RemediationHint suggests the next action to present to the user.
	RemediationHint SharedObjectHealthRemediationHint `protobuf:"varint,4,opt,name=remediation_hint,json=remediationHint,proto3" json:"remediationHint,omitempty"`
	// Error preserves provider-specific or body-specific detail when needed.
	Error string `protobuf:"bytes,5,opt,name=error,proto3" json:"error,omitempty"`
	// Metadata reserves an opaque slot for future provider-specific or body-specific remediation data.
	// Empty in v1. Callers must treat the contents as opaque.
	Metadata []byte `protobuf:"bytes,6,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// contains filtered or unexported fields
}

SharedObjectHealth describes the current lifecycle and failure state of a SharedObject. This payload is shared across local, spacewave, and CDN providers.

func BuildSharedObjectHealthFromError

func BuildSharedObjectHealthFromError(
	layer SharedObjectHealthLayer,
	err error,
) *SharedObjectHealth

BuildSharedObjectHealthFromError maps a known error into a SharedObjectHealth snapshot.

func GetSharedObjectHealthFromError

func GetSharedObjectHealthFromError(err error) (*SharedObjectHealth, bool)

GetSharedObjectHealthFromError returns an attached SharedObjectHealth snapshot when available.

func NewSharedObjectClosedHealth

func NewSharedObjectClosedHealth(
	layer SharedObjectHealthLayer,
	commonReason SharedObjectHealthCommonReason,
	remediationHint SharedObjectHealthRemediationHint,
	errText string,
) *SharedObjectHealth

NewSharedObjectClosedHealth constructs a closed SharedObjectHealth snapshot.

func NewSharedObjectHealth

func NewSharedObjectHealth(
	status SharedObjectHealthStatus,
	layer SharedObjectHealthLayer,
	commonReason SharedObjectHealthCommonReason,
	remediationHint SharedObjectHealthRemediationHint,
	errText string,
) *SharedObjectHealth

NewSharedObjectHealth constructs a SharedObjectHealth snapshot.

func NewSharedObjectLoadingHealth

func NewSharedObjectLoadingHealth(
	layer SharedObjectHealthLayer,
) *SharedObjectHealth

NewSharedObjectLoadingHealth constructs a loading SharedObjectHealth snapshot.

func NewSharedObjectReadyHealth

func NewSharedObjectReadyHealth(
	layer SharedObjectHealthLayer,
) *SharedObjectHealth

NewSharedObjectReadyHealth constructs a ready SharedObjectHealth snapshot.

func (*SharedObjectHealth) CloneMessageVT

func (m *SharedObjectHealth) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SharedObjectHealth) CloneVT

func (m *SharedObjectHealth) CloneVT() *SharedObjectHealth

func (*SharedObjectHealth) EqualMessageVT

func (this *SharedObjectHealth) EqualMessageVT(thatMsg any) bool

func (*SharedObjectHealth) EqualVT

func (this *SharedObjectHealth) EqualVT(that *SharedObjectHealth) bool

func (*SharedObjectHealth) GetCommonReason

func (*SharedObjectHealth) GetError

func (x *SharedObjectHealth) GetError() string

func (*SharedObjectHealth) GetLayer

func (*SharedObjectHealth) GetMetadata

func (x *SharedObjectHealth) GetMetadata() []byte

func (*SharedObjectHealth) GetRemediationHint

func (x *SharedObjectHealth) GetRemediationHint() SharedObjectHealthRemediationHint

func (*SharedObjectHealth) GetStatus

func (*SharedObjectHealth) MarshalJSON

func (x *SharedObjectHealth) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SharedObjectHealth to JSON.

func (*SharedObjectHealth) MarshalProtoJSON

func (x *SharedObjectHealth) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SharedObjectHealth message to JSON.

func (*SharedObjectHealth) MarshalProtoText

func (x *SharedObjectHealth) MarshalProtoText() string

func (*SharedObjectHealth) MarshalToSizedBufferVT

func (m *SharedObjectHealth) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SharedObjectHealth) MarshalToVT

func (m *SharedObjectHealth) MarshalToVT(dAtA []byte) (int, error)

func (*SharedObjectHealth) MarshalVT

func (m *SharedObjectHealth) MarshalVT() (dAtA []byte, err error)

func (*SharedObjectHealth) ProtoMessage

func (*SharedObjectHealth) ProtoMessage()

func (*SharedObjectHealth) Reset

func (x *SharedObjectHealth) Reset()

func (*SharedObjectHealth) SizeVT

func (m *SharedObjectHealth) SizeVT() (n int)

func (*SharedObjectHealth) String

func (x *SharedObjectHealth) String() string

func (*SharedObjectHealth) UnmarshalJSON

func (x *SharedObjectHealth) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SharedObjectHealth from JSON.

func (*SharedObjectHealth) UnmarshalProtoJSON

func (x *SharedObjectHealth) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SharedObjectHealth message from JSON.

func (*SharedObjectHealth) UnmarshalVT

func (m *SharedObjectHealth) UnmarshalVT(dAtA []byte) error

type SharedObjectHealthAccessor

type SharedObjectHealthAccessor interface {
	// AccessSharedObjectHealth adds a reference to SharedObject health and returns the state container.
	// Returns a release function. Accepts a function that is called if the Watchable becomes invalid.
	AccessSharedObjectHealth(ctx context.Context, released func()) (ccontainer.Watchable[*SharedObjectHealth], func(), error)
}

SharedObjectHealthAccessor exposes SharedObject health directly from a mounted object.

type SharedObjectHealthCommonReason

type SharedObjectHealthCommonReason int32

SharedObjectHealthCommonReason identifies a stable cross-provider reason when one is known.

const (
	// SHARED_OBJECT_HEALTH_COMMON_REASON_UNKNOWN is the zero / invalid value.
	SharedObjectHealthCommonReason_SHARED_OBJECT_HEALTH_COMMON_REASON_UNKNOWN SharedObjectHealthCommonReason = 0
	// SHARED_OBJECT_HEALTH_COMMON_REASON_NOT_FOUND indicates the SharedObject or required body data could not be found.
	SharedObjectHealthCommonReason_SHARED_OBJECT_HEALTH_COMMON_REASON_NOT_FOUND SharedObjectHealthCommonReason = 1
	// SHARED_OBJECT_HEALTH_COMMON_REASON_ACCESS_REVOKED indicates access to the SharedObject was removed.
	SharedObjectHealthCommonReason_SHARED_OBJECT_HEALTH_COMMON_REASON_ACCESS_REVOKED SharedObjectHealthCommonReason = 2
	// SHARED_OBJECT_HEALTH_COMMON_REASON_INITIAL_STATE_REJECTED indicates the initial SharedObject state failed verification.
	SharedObjectHealthCommonReason_SHARED_OBJECT_HEALTH_COMMON_REASON_INITIAL_STATE_REJECTED SharedObjectHealthCommonReason = 3
	// SHARED_OBJECT_HEALTH_COMMON_REASON_BLOCK_NOT_FOUND indicates a required block is missing.
	SharedObjectHealthCommonReason_SHARED_OBJECT_HEALTH_COMMON_REASON_BLOCK_NOT_FOUND SharedObjectHealthCommonReason = 4
	// SHARED_OBJECT_HEALTH_COMMON_REASON_TRANSFORM_CONFIG_DECODE_FAILED indicates the transform configuration could not be decoded.
	SharedObjectHealthCommonReason_SHARED_OBJECT_HEALTH_COMMON_REASON_TRANSFORM_CONFIG_DECODE_FAILED SharedObjectHealthCommonReason = 5
	// SHARED_OBJECT_HEALTH_COMMON_REASON_BODY_CONFIG_DECODE_FAILED indicates the body configuration could not be decoded.
	SharedObjectHealthCommonReason_SHARED_OBJECT_HEALTH_COMMON_REASON_BODY_CONFIG_DECODE_FAILED SharedObjectHealthCommonReason = 6
)

func (SharedObjectHealthCommonReason) Enum

func (SharedObjectHealthCommonReason) MarshalJSON

func (x SharedObjectHealthCommonReason) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SharedObjectHealthCommonReason to JSON.

func (SharedObjectHealthCommonReason) MarshalProtoJSON

func (x SharedObjectHealthCommonReason) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SharedObjectHealthCommonReason to JSON.

func (SharedObjectHealthCommonReason) MarshalProtoText

func (x SharedObjectHealthCommonReason) MarshalProtoText() string

func (SharedObjectHealthCommonReason) MarshalText

func (x SharedObjectHealthCommonReason) MarshalText() ([]byte, error)

MarshalText marshals the SharedObjectHealthCommonReason to text.

func (SharedObjectHealthCommonReason) String

func (*SharedObjectHealthCommonReason) UnmarshalJSON

func (x *SharedObjectHealthCommonReason) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SharedObjectHealthCommonReason from JSON.

func (*SharedObjectHealthCommonReason) UnmarshalProtoJSON

func (x *SharedObjectHealthCommonReason) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SharedObjectHealthCommonReason from JSON.

func (*SharedObjectHealthCommonReason) UnmarshalText

func (x *SharedObjectHealthCommonReason) UnmarshalText(b []byte) error

UnmarshalText unmarshals the SharedObjectHealthCommonReason from text.

type SharedObjectHealthError

type SharedObjectHealthError interface {
	error

	// GetSharedObjectHealth returns the attached SharedObjectHealth snapshot.
	GetSharedObjectHealth() *SharedObjectHealth
}

SharedObjectHealthError exposes a SharedObjectHealth snapshot through an error wrapper.

type SharedObjectHealthLayer

type SharedObjectHealthLayer int32

SharedObjectHealthLayer identifies where the current issue is happening.

const (
	// SHARED_OBJECT_HEALTH_LAYER_UNKNOWN is the zero / invalid value.
	SharedObjectHealthLayer_SHARED_OBJECT_HEALTH_LAYER_UNKNOWN SharedObjectHealthLayer = 0
	// SHARED_OBJECT_HEALTH_LAYER_SHARED_OBJECT indicates the failure happened while mounting or syncing the SharedObject itself.
	SharedObjectHealthLayer_SHARED_OBJECT_HEALTH_LAYER_SHARED_OBJECT SharedObjectHealthLayer = 1
	// SHARED_OBJECT_HEALTH_LAYER_BODY indicates the failure happened while mounting or decoding the body.
	SharedObjectHealthLayer_SHARED_OBJECT_HEALTH_LAYER_BODY SharedObjectHealthLayer = 2
)

func (SharedObjectHealthLayer) Enum

func (SharedObjectHealthLayer) MarshalJSON

func (x SharedObjectHealthLayer) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SharedObjectHealthLayer to JSON.

func (SharedObjectHealthLayer) MarshalProtoJSON

func (x SharedObjectHealthLayer) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SharedObjectHealthLayer to JSON.

func (SharedObjectHealthLayer) MarshalProtoText

func (x SharedObjectHealthLayer) MarshalProtoText() string

func (SharedObjectHealthLayer) MarshalText

func (x SharedObjectHealthLayer) MarshalText() ([]byte, error)

MarshalText marshals the SharedObjectHealthLayer to text.

func (SharedObjectHealthLayer) String

func (x SharedObjectHealthLayer) String() string

func (*SharedObjectHealthLayer) UnmarshalJSON

func (x *SharedObjectHealthLayer) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SharedObjectHealthLayer from JSON.

func (*SharedObjectHealthLayer) UnmarshalProtoJSON

func (x *SharedObjectHealthLayer) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SharedObjectHealthLayer from JSON.

func (*SharedObjectHealthLayer) UnmarshalText

func (x *SharedObjectHealthLayer) UnmarshalText(b []byte) error

UnmarshalText unmarshals the SharedObjectHealthLayer from text.

type SharedObjectHealthProvider

type SharedObjectHealthProvider interface {
	// AccessSharedObjectHealth adds a reference to SharedObject health by ref.
	// Returns a release function. Accepts a function that is called if the Watchable becomes invalid.
	AccessSharedObjectHealth(ctx context.Context, ref *SharedObjectRef, released func()) (ccontainer.Watchable[*SharedObjectHealth], func(), error)
}

SharedObjectHealthProvider streams SharedObject health snapshots before body mount.

func GetSharedObjectHealthProvider

func GetSharedObjectHealthProvider(
	provAcc provider.ProviderAccount,
) (SharedObjectHealthProvider, bool)

GetSharedObjectHealthProvider returns the optional SharedObjectHealthProvider for a ProviderAccount.

type SharedObjectHealthRemediationHint

type SharedObjectHealthRemediationHint int32

SharedObjectHealthRemediationHint suggests a next step for the caller or UI.

const (
	// SHARED_OBJECT_HEALTH_REMEDIATION_HINT_UNKNOWN is the zero / invalid value.
	SharedObjectHealthRemediationHint_SHARED_OBJECT_HEALTH_REMEDIATION_HINT_UNKNOWN SharedObjectHealthRemediationHint = 0
	// SHARED_OBJECT_HEALTH_REMEDIATION_HINT_NONE indicates no explicit action is suggested.
	SharedObjectHealthRemediationHint_SHARED_OBJECT_HEALTH_REMEDIATION_HINT_NONE SharedObjectHealthRemediationHint = 1
	// SHARED_OBJECT_HEALTH_REMEDIATION_HINT_RETRY indicates retrying the operation may succeed.
	SharedObjectHealthRemediationHint_SHARED_OBJECT_HEALTH_REMEDIATION_HINT_RETRY SharedObjectHealthRemediationHint = 2
	// SHARED_OBJECT_HEALTH_REMEDIATION_HINT_REQUEST_ACCESS indicates the user should request access again.
	SharedObjectHealthRemediationHint_SHARED_OBJECT_HEALTH_REMEDIATION_HINT_REQUEST_ACCESS SharedObjectHealthRemediationHint = 3
	// SHARED_OBJECT_HEALTH_REMEDIATION_HINT_CONTACT_OWNER indicates the user should contact the owner or operator.
	SharedObjectHealthRemediationHint_SHARED_OBJECT_HEALTH_REMEDIATION_HINT_CONTACT_OWNER SharedObjectHealthRemediationHint = 4
	// SHARED_OBJECT_HEALTH_REMEDIATION_HINT_REPAIR_SOURCE_DATA indicates the backing SharedObject or body data must be repaired.
	SharedObjectHealthRemediationHint_SHARED_OBJECT_HEALTH_REMEDIATION_HINT_REPAIR_SOURCE_DATA SharedObjectHealthRemediationHint = 5
)

func (SharedObjectHealthRemediationHint) Enum

func (SharedObjectHealthRemediationHint) MarshalJSON

func (x SharedObjectHealthRemediationHint) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SharedObjectHealthRemediationHint to JSON.

func (SharedObjectHealthRemediationHint) MarshalProtoJSON

func (x SharedObjectHealthRemediationHint) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SharedObjectHealthRemediationHint to JSON.

func (SharedObjectHealthRemediationHint) MarshalProtoText

func (x SharedObjectHealthRemediationHint) MarshalProtoText() string

func (SharedObjectHealthRemediationHint) MarshalText

func (x SharedObjectHealthRemediationHint) MarshalText() ([]byte, error)

MarshalText marshals the SharedObjectHealthRemediationHint to text.

func (SharedObjectHealthRemediationHint) String

func (*SharedObjectHealthRemediationHint) UnmarshalJSON

func (x *SharedObjectHealthRemediationHint) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SharedObjectHealthRemediationHint from JSON.

func (*SharedObjectHealthRemediationHint) UnmarshalProtoJSON

func (x *SharedObjectHealthRemediationHint) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SharedObjectHealthRemediationHint from JSON.

func (*SharedObjectHealthRemediationHint) UnmarshalText

func (x *SharedObjectHealthRemediationHint) UnmarshalText(b []byte) error

UnmarshalText unmarshals the SharedObjectHealthRemediationHint from text.

type SharedObjectHealthStatus

type SharedObjectHealthStatus int32

SharedObjectHealthStatus describes the lifecycle status of a SharedObject mount.

const (
	// SHARED_OBJECT_HEALTH_STATUS_UNKNOWN is the zero / invalid value.
	SharedObjectHealthStatus_SHARED_OBJECT_HEALTH_STATUS_UNKNOWN SharedObjectHealthStatus = 0
	// SHARED_OBJECT_HEALTH_STATUS_LOADING indicates the object is still mounting.
	SharedObjectHealthStatus_SHARED_OBJECT_HEALTH_STATUS_LOADING SharedObjectHealthStatus = 1
	// SHARED_OBJECT_HEALTH_STATUS_READY indicates the object is mounted and usable.
	SharedObjectHealthStatus_SHARED_OBJECT_HEALTH_STATUS_READY SharedObjectHealthStatus = 2
	// SHARED_OBJECT_HEALTH_STATUS_DEGRADED indicates the object is usable with a known problem.
	SharedObjectHealthStatus_SHARED_OBJECT_HEALTH_STATUS_DEGRADED SharedObjectHealthStatus = 3
	// SHARED_OBJECT_HEALTH_STATUS_CLOSED indicates the mount cannot proceed without remediation.
	SharedObjectHealthStatus_SHARED_OBJECT_HEALTH_STATUS_CLOSED SharedObjectHealthStatus = 4
)

func (SharedObjectHealthStatus) Enum

func (SharedObjectHealthStatus) MarshalJSON

func (x SharedObjectHealthStatus) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SharedObjectHealthStatus to JSON.

func (SharedObjectHealthStatus) MarshalProtoJSON

func (x SharedObjectHealthStatus) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SharedObjectHealthStatus to JSON.

func (SharedObjectHealthStatus) MarshalProtoText

func (x SharedObjectHealthStatus) MarshalProtoText() string

func (SharedObjectHealthStatus) MarshalText

func (x SharedObjectHealthStatus) MarshalText() ([]byte, error)

MarshalText marshals the SharedObjectHealthStatus to text.

func (SharedObjectHealthStatus) String

func (x SharedObjectHealthStatus) String() string

func (*SharedObjectHealthStatus) UnmarshalJSON

func (x *SharedObjectHealthStatus) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SharedObjectHealthStatus from JSON.

func (*SharedObjectHealthStatus) UnmarshalProtoJSON

func (x *SharedObjectHealthStatus) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SharedObjectHealthStatus from JSON.

func (*SharedObjectHealthStatus) UnmarshalText

func (x *SharedObjectHealthStatus) UnmarshalText(b []byte) error

UnmarshalText unmarshals the SharedObjectHealthStatus from text.

type SharedObjectList

type SharedObjectList struct {

	// SharedObjects is the list of shared objects.
	SharedObjects []*SharedObjectListEntry `protobuf:"bytes,1,rep,name=shared_objects,json=sharedObjects,proto3" json:"sharedObjects,omitempty"`
	// contains filtered or unexported fields
}

SharedObjectList is the list of objects in the provider account.

func (*SharedObjectList) CloneMessageVT

func (m *SharedObjectList) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SharedObjectList) CloneVT

func (m *SharedObjectList) CloneVT() *SharedObjectList

func (*SharedObjectList) EqualMessageVT

func (this *SharedObjectList) EqualMessageVT(thatMsg any) bool

func (*SharedObjectList) EqualVT

func (this *SharedObjectList) EqualVT(that *SharedObjectList) bool

func (*SharedObjectList) GetSharedObjects

func (x *SharedObjectList) GetSharedObjects() []*SharedObjectListEntry

func (*SharedObjectList) MarshalJSON

func (x *SharedObjectList) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SharedObjectList to JSON.

func (*SharedObjectList) MarshalProtoJSON

func (x *SharedObjectList) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SharedObjectList message to JSON.

func (*SharedObjectList) MarshalProtoText

func (x *SharedObjectList) MarshalProtoText() string

func (*SharedObjectList) MarshalToSizedBufferVT

func (m *SharedObjectList) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SharedObjectList) MarshalToVT

func (m *SharedObjectList) MarshalToVT(dAtA []byte) (int, error)

func (*SharedObjectList) MarshalVT

func (m *SharedObjectList) MarshalVT() (dAtA []byte, err error)

func (*SharedObjectList) ProtoMessage

func (*SharedObjectList) ProtoMessage()

func (*SharedObjectList) Reset

func (x *SharedObjectList) Reset()

func (*SharedObjectList) SizeVT

func (m *SharedObjectList) SizeVT() (n int)

func (*SharedObjectList) String

func (x *SharedObjectList) String() string

func (*SharedObjectList) UnmarshalJSON

func (x *SharedObjectList) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SharedObjectList from JSON.

func (*SharedObjectList) UnmarshalProtoJSON

func (x *SharedObjectList) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SharedObjectList message from JSON.

func (*SharedObjectList) UnmarshalVT

func (m *SharedObjectList) UnmarshalVT(dAtA []byte) error

type SharedObjectListEntry

type SharedObjectListEntry struct {

	// Ref is the reference to the shared object.
	Ref *SharedObjectRef `protobuf:"bytes,1,opt,name=ref,proto3" json:"ref,omitempty"`
	// Meta is the metadata for the shared object.
	Meta *SharedObjectMeta `protobuf:"bytes,2,opt,name=meta,proto3" json:"meta,omitempty"`
	// Source indicates how the shared object was acquired.
	// Known values: "created" (owner-created), "shared" (invite-received or org-enrolled).
	Source string `protobuf:"bytes,3,opt,name=source,proto3" json:"source,omitempty"`
	// contains filtered or unexported fields
}

SharedObjectListEntry is an entry in the SharedObjectList.

func (*SharedObjectListEntry) CloneMessageVT

func (*SharedObjectListEntry) CloneVT

func (*SharedObjectListEntry) EqualMessageVT

func (this *SharedObjectListEntry) EqualMessageVT(thatMsg any) bool

func (*SharedObjectListEntry) EqualVT

func (this *SharedObjectListEntry) EqualVT(that *SharedObjectListEntry) bool

func (*SharedObjectListEntry) GetMeta

func (*SharedObjectListEntry) GetRef

func (*SharedObjectListEntry) GetSource

func (x *SharedObjectListEntry) GetSource() string

func (*SharedObjectListEntry) MarshalJSON

func (x *SharedObjectListEntry) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SharedObjectListEntry to JSON.

func (*SharedObjectListEntry) MarshalProtoJSON

func (x *SharedObjectListEntry) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SharedObjectListEntry message to JSON.

func (*SharedObjectListEntry) MarshalProtoText

func (x *SharedObjectListEntry) MarshalProtoText() string

func (*SharedObjectListEntry) MarshalToSizedBufferVT

func (m *SharedObjectListEntry) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SharedObjectListEntry) MarshalToVT

func (m *SharedObjectListEntry) MarshalToVT(dAtA []byte) (int, error)

func (*SharedObjectListEntry) MarshalVT

func (m *SharedObjectListEntry) MarshalVT() (dAtA []byte, err error)

func (*SharedObjectListEntry) ProtoMessage

func (*SharedObjectListEntry) ProtoMessage()

func (*SharedObjectListEntry) Reset

func (x *SharedObjectListEntry) Reset()

func (*SharedObjectListEntry) SizeVT

func (m *SharedObjectListEntry) SizeVT() (n int)

func (*SharedObjectListEntry) String

func (x *SharedObjectListEntry) String() string

func (*SharedObjectListEntry) UnmarshalJSON

func (x *SharedObjectListEntry) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SharedObjectListEntry from JSON.

func (*SharedObjectListEntry) UnmarshalProtoJSON

func (x *SharedObjectListEntry) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SharedObjectListEntry message from JSON.

func (*SharedObjectListEntry) UnmarshalVT

func (m *SharedObjectListEntry) UnmarshalVT(dAtA []byte) error

type SharedObjectMeta

type SharedObjectMeta struct {

	// BodyType is the type of object in the body of the shared object.
	// Known types: "space"
	BodyType string `protobuf:"bytes,1,opt,name=body_type,json=bodyType,proto3" json:"bodyType,omitempty"`
	// BodyMeta is additional metadata about the shared object body.
	BodyMeta []byte `protobuf:"bytes,2,opt,name=body_meta,json=bodyMeta,proto3" json:"bodyMeta,omitempty"`
	// AccountPrivate marks a shared object as private to one account and not
	// eligible for transfer, merge, or ownership-migration flows.
	AccountPrivate bool `protobuf:"varint,3,opt,name=account_private,json=accountPrivate,proto3" json:"accountPrivate,omitempty"`
	// contains filtered or unexported fields
}

SharedObjectMeta is the contents of the provider_feature_meta field for a SharedObject.

func (*SharedObjectMeta) CloneMessageVT

func (m *SharedObjectMeta) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SharedObjectMeta) CloneVT

func (m *SharedObjectMeta) CloneVT() *SharedObjectMeta

func (*SharedObjectMeta) EqualMessageVT

func (this *SharedObjectMeta) EqualMessageVT(thatMsg any) bool

func (*SharedObjectMeta) EqualVT

func (this *SharedObjectMeta) EqualVT(that *SharedObjectMeta) bool

func (*SharedObjectMeta) GetAccountPrivate

func (x *SharedObjectMeta) GetAccountPrivate() bool

func (*SharedObjectMeta) GetBodyMeta

func (x *SharedObjectMeta) GetBodyMeta() []byte

func (*SharedObjectMeta) GetBodyType

func (x *SharedObjectMeta) GetBodyType() string

func (*SharedObjectMeta) MarshalJSON

func (x *SharedObjectMeta) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SharedObjectMeta to JSON.

func (*SharedObjectMeta) MarshalProtoJSON

func (x *SharedObjectMeta) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SharedObjectMeta message to JSON.

func (*SharedObjectMeta) MarshalProtoText

func (x *SharedObjectMeta) MarshalProtoText() string

func (*SharedObjectMeta) MarshalToSizedBufferVT

func (m *SharedObjectMeta) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SharedObjectMeta) MarshalToVT

func (m *SharedObjectMeta) MarshalToVT(dAtA []byte) (int, error)

func (*SharedObjectMeta) MarshalVT

func (m *SharedObjectMeta) MarshalVT() (dAtA []byte, err error)

func (*SharedObjectMeta) ProtoMessage

func (*SharedObjectMeta) ProtoMessage()

func (*SharedObjectMeta) Reset

func (x *SharedObjectMeta) Reset()

func (*SharedObjectMeta) SizeVT

func (m *SharedObjectMeta) SizeVT() (n int)

func (*SharedObjectMeta) String

func (x *SharedObjectMeta) String() string

func (*SharedObjectMeta) UnmarshalJSON

func (x *SharedObjectMeta) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SharedObjectMeta from JSON.

func (*SharedObjectMeta) UnmarshalProtoJSON

func (x *SharedObjectMeta) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SharedObjectMeta message from JSON.

func (*SharedObjectMeta) UnmarshalVT

func (m *SharedObjectMeta) UnmarshalVT(dAtA []byte) error

func (*SharedObjectMeta) Validate

func (m *SharedObjectMeta) Validate() error

Validate validates the metadata.

type SharedObjectProvider

type SharedObjectProvider interface {
	provider.ProviderAccountFeature

	// CreateSharedObject creates a new shared object with the given details.
	// The ID may not necessarily be used for the shared object ID.
	// ownerType is "account" or "organization"; ownerID is the principal id
	// (account id for account-owned, org id for org-owned).
	CreateSharedObject(ctx context.Context, id string, meta *SharedObjectMeta, ownerType, ownerID string) (*SharedObjectRef, error)

	// MountSharedObject attempts to mount a SharedObject returning the object handle and a release function.
	//
	// This also mounts the block store associated with the shared object.
	//
	// note: use the MountSharedObject directive to call this.
	// usually called by the provider controller
	MountSharedObject(ctx context.Context, ref *SharedObjectRef, released func()) (SharedObject, func(), error)

	// DeleteSharedObject deletes the shared object with the given ID.
	// Removes from the shared object list, cleans up GC references,
	// and removes the bucket from the volume.
	DeleteSharedObject(ctx context.Context, id string) error

	// AccessSharedObjectList adds a reference to the list of shared objects and returns the container.
	// Returns a release function. Accepts a function that is called if the Watchable becomes invalid.
	AccessSharedObjectList(ctx context.Context, released func()) (ccontainer.Watchable[*SharedObjectList], func(), error)
}

SharedObjectProvider implements ProviderFeature_SHARED_OBJECT.

func GetSharedObjectProviderAccountFeature

func GetSharedObjectProviderAccountFeature(ctx context.Context, provAcc provider.ProviderAccount) (SharedObjectProvider, error)

GetSharedObjectProviderAccountFeature returns the SharedObjectProvider for a ProviderAccount.

type SharedObjectRecoveryDecoder

type SharedObjectRecoveryDecoder interface {
	// DecryptSharedObjectRecoveryEnvelope decrypts the envelope into recovery material.
	DecryptSharedObjectRecoveryEnvelope(ctx context.Context, env *SOEntityRecoveryEnvelope) (*SOEntityRecoveryMaterial, error)
}

SharedObjectRecoveryDecoder decrypts shared object recovery envelopes.

type SharedObjectRecoveryProvider

type SharedObjectRecoveryProvider interface {
	provider.ProviderAccountFeature

	// GetSelfEntityID returns the stable entity ID for the mounted provider account.
	GetSelfEntityID(ctx context.Context) (string, error)

	// ReadSharedObjectRecoveryEnvelope reads the current recovery envelope for the entity on an SO.
	ReadSharedObjectRecoveryEnvelope(ctx context.Context, ref *SharedObjectRef) (*SOEntityRecoveryEnvelope, error)

	// GetSharedObjectRecoveryDecoder returns a provider-owned decoder for recovery envelopes.
	GetSharedObjectRecoveryDecoder(ctx context.Context) (SharedObjectRecoveryDecoder, error)
}

SharedObjectRecoveryProvider implements ProviderFeature_SHARED_OBJECT_RECOVERY.

func GetSharedObjectRecoveryProviderAccountFeature

func GetSharedObjectRecoveryProviderAccountFeature(ctx context.Context, provAcc provider.ProviderAccount) (SharedObjectRecoveryProvider, error)

GetSharedObjectRecoveryProviderAccountFeature returns the SharedObjectRecoveryProvider for a ProviderAccount.

type SharedObjectRef

type SharedObjectRef struct {

	// ProviderResourceRef is the reference to the resource on the provider.
	ProviderResourceRef *provider.ProviderResourceRef `protobuf:"bytes,1,opt,name=provider_resource_ref,json=providerResourceRef,proto3" json:"providerResourceRef,omitempty"`
	// BlockStoreId is the identifier of the block store.
	// The block store must exist on the same provider + account id.
	BlockStoreId string `protobuf:"bytes,2,opt,name=block_store_id,json=blockStoreId,proto3" json:"blockStoreId,omitempty"`
	// contains filtered or unexported fields
}

SharedObjectRef is a reference to a shared object managed by a provider.

func NewSharedObjectRef

func NewSharedObjectRef(providerID, providerAccountID, sobjectID, blockStoreID string) *SharedObjectRef

NewSharedObjectRef builds a new SharedObjectRef.

func UnmarshalSharedObjectRef

func UnmarshalSharedObjectRef(ctx context.Context, bcs *block.Cursor) (*SharedObjectRef, error)

UnmarshalSharedObjectRef unmarshals a SharedObjectRef from a block cursor.

func (*SharedObjectRef) CloneMessageVT

func (m *SharedObjectRef) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SharedObjectRef) CloneVT

func (m *SharedObjectRef) CloneVT() *SharedObjectRef

func (*SharedObjectRef) EqualMessageVT

func (this *SharedObjectRef) EqualMessageVT(thatMsg any) bool

func (*SharedObjectRef) EqualVT

func (this *SharedObjectRef) EqualVT(that *SharedObjectRef) bool

func (*SharedObjectRef) GetBlockStoreId

func (x *SharedObjectRef) GetBlockStoreId() string

func (*SharedObjectRef) GetLogger

func (i *SharedObjectRef) GetLogger(le *logrus.Entry) *logrus.Entry

GetLogger adds debug values to the logger.

func (*SharedObjectRef) GetProviderResourceRef

func (x *SharedObjectRef) GetProviderResourceRef() *provider.ProviderResourceRef

func (*SharedObjectRef) MarshalBlock

func (i *SharedObjectRef) MarshalBlock() ([]byte, error)

MarshalBlock marshals the block to binary. This is the initial step of marshaling, before transformations.

func (*SharedObjectRef) MarshalJSON

func (x *SharedObjectRef) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SharedObjectRef to JSON.

func (*SharedObjectRef) MarshalProtoJSON

func (x *SharedObjectRef) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SharedObjectRef message to JSON.

func (*SharedObjectRef) MarshalProtoText

func (x *SharedObjectRef) MarshalProtoText() string

func (*SharedObjectRef) MarshalToSizedBufferVT

func (m *SharedObjectRef) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SharedObjectRef) MarshalToVT

func (m *SharedObjectRef) MarshalToVT(dAtA []byte) (int, error)

func (*SharedObjectRef) MarshalVT

func (m *SharedObjectRef) MarshalVT() (dAtA []byte, err error)

func (*SharedObjectRef) ProtoMessage

func (*SharedObjectRef) ProtoMessage()

func (*SharedObjectRef) Reset

func (x *SharedObjectRef) Reset()

func (*SharedObjectRef) SizeVT

func (m *SharedObjectRef) SizeVT() (n int)

func (*SharedObjectRef) String

func (x *SharedObjectRef) String() string

func (*SharedObjectRef) UnmarshalBlock

func (i *SharedObjectRef) UnmarshalBlock(data []byte) error

UnmarshalBlock unmarshals the block to the object. This is the final step of decoding, after transformations.

func (*SharedObjectRef) UnmarshalJSON

func (x *SharedObjectRef) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SharedObjectRef from JSON.

func (*SharedObjectRef) UnmarshalProtoJSON

func (x *SharedObjectRef) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SharedObjectRef message from JSON.

func (*SharedObjectRef) UnmarshalVT

func (m *SharedObjectRef) UnmarshalVT(dAtA []byte) error

func (*SharedObjectRef) Validate

func (i *SharedObjectRef) Validate() error

Validate validates the shared object ref.

type SharedObjectStateSnapshot

type SharedObjectStateSnapshot interface {
	// GetParticipantConfig returns the participant record for our participant.
	// uses the peer identity from the SharedObject.
	// returns ErrNotParticipant if the local peer is not a participant.
	GetParticipantConfig(ctx context.Context) (*SOParticipantConfig, error)

	// GetTransformer returns the transformer used for the root state and operations.
	// Returns the same transformer used for encoding/decoding the root state.
	GetTransformer(ctx context.Context) (*block_transform.Transformer, error)

	// GetTransformInfo returns redacted transform configuration for display.
	// Decrypts the local participant's grant to extract step configs, then
	// strips sensitive fields (encryption keys). Returns epoch and grant count.
	GetTransformInfo(ctx context.Context) (*TransformInfo, error)

	// GetOpQueue returns the operation queue for our participant.
	// Returns the list of queued ops with nonces + the local queue (no nonce yet).
	// uses the peer identity from the SharedObject.
	GetOpQueue(ctx context.Context) ([]*SOOperation, []*QueuedSOOperation, error)

	// GetRootInner attempts to decode the current SORootInner and returns it.
	// uses the peer identity from the SharedObject to decode.
	//
	// If the shared object is blank, returns nil, nil.
	GetRootInner(ctx context.Context) (*SORootInner, error)

	// ProcessOperations processes operations as a validator calling cb.
	// The ops should be processed in the order they are provided.
	// The results must be a subset of ops (but does not need to have all ops).
	// Returns the updated root state.
	// This function is called by the SharedObject controller.
	// You probably want to call SharedObject.ProcessOperations instead.
	ProcessOperations(
		ctx context.Context,
		ops []*SOOperation,
		cb SnapshotProcessOpsFunc,
	) (
		nextRoot *SORoot,
		rejectedOps []*SOOperationRejection,
		acceptedOps []*SOOperation,
		err error,
	)
}

SharedObjectStateSnapshot is the state snapshot interface for the SharedObject.

type SnapshotProcessOpsFunc

type SnapshotProcessOpsFunc = func(
	ctx context.Context,
	currentStateData []byte,
	ops []*SOOperationInner,
) (rawNextStateData *[]byte, opResults []*SOOperationResult, err error)

SnapshotProcessOpsFunc is a function which processes operations against a state. cb is called with the state snapshot and the decoded inner state. If rawNextStateData is nil, no changes will be applied to the state (no-op).

type TransformInfo

type TransformInfo struct {
	// Steps contains the transform steps with sensitive fields redacted.
	Steps []*block_transform.StepConfig
	// GrantCount is the number of participants with active grants.
	GrantCount uint32
}

TransformInfo contains redacted transform configuration for display.

Directories

Path Synopsis
world

Jump to

Keyboard shortcuts

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