spacepayloads

package
v0.11.13 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SpaceReserved = "any-sync.space"
)

Variables

View Source
var ErrIncorrectIdentity = errors.New("incorrect identity")
View Source
var ErrIncorrectOneToOnePayload = errors.New("incorrect onetoone payload")

Functions

func NewSpaceId

func NewSpaceId(id string, repKey uint64) string

func StoragePayloadForOneToOneSpace added in v0.10.6

func StoragePayloadForOneToOneSpace(aSk crypto.PrivKey, bPk crypto.PubKey) (storagePayload spacestorage.SpaceStorageCreatePayload, err error)

func StoragePayloadForSpaceCreate

func StoragePayloadForSpaceCreate(payload SpaceCreatePayload) (storagePayload spacestorage.SpaceStorageCreatePayload, err error)

func StoragePayloadForSpaceCreateV1 added in v0.10.6

func StoragePayloadForSpaceCreateV1(payload SpaceCreatePayload) (storagePayload spacestorage.SpaceStorageCreatePayload, err error)

func StoragePayloadForSpaceDerive

func StoragePayloadForSpaceDerive(payload SpaceDerivePayload) (storagePayload spacestorage.SpaceStorageCreatePayload, err error)

func ValidateSpaceHeader

func ValidateSpaceHeader(rawHeaderWithId *spacesyncproto.RawSpaceHeaderWithId, identity crypto.PubKey, aclPayload []byte, settingsPayload []byte) (needCheckSpaceId bool, err error)

func ValidateSpaceStorageCreatePayload

func ValidateSpaceStorageCreatePayload(payload spacestorage.SpaceStorageCreatePayload) (err error)

Types

type SpaceCreatePayload

type SpaceCreatePayload struct {
	// SigningKey is the signing key of the owner
	SigningKey crypto.PrivKey
	// SpaceType is an arbitrary string
	SpaceType string
	// ReplicationKey is a key which is to be used to determine the node where the space should be held
	ReplicationKey uint64
	// SpacePayload is an arbitrary payload related to space type
	SpacePayload []byte // we probably should put onetooneinfo here
	// MasterKey is the master key of the owner
	MasterKey crypto.PrivKey
	// ReadKey is the first read key of space
	ReadKey crypto.SymKey
	// MetadataKey is the first metadata key of space
	MetadataKey crypto.PrivKey
	// Metadata is the metadata of the owner
	Metadata []byte
}

type SpaceDerivePayload

type SpaceDerivePayload struct {
	SigningKey   crypto.PrivKey
	MasterKey    crypto.PrivKey
	SpaceType    string
	SpacePayload []byte
}

Jump to

Keyboard shortcuts

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