marriage

package
v1.7.9 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(db sql.Executor, marriage Info) error

Add inserts a nodeID to the marriages table for the given MarriageID. If the nodeID already exists in the table, it is updated. Updates cannot change the MarriageID.

func IterateOps

func IterateOps(
	db sql.Executor,
	operations builder.Operations,
	fn func(Info) bool,
) error

func NodeIDsByID

func NodeIDsByID(db sql.Executor, id ID) ([]types.NodeID, error)

func UpdateMarriageID

func UpdateMarriageID(db sql.Executor, oldID, newID ID) error

Types

type ID

type ID int

func FindIDByNodeID

func FindIDByNodeID(db sql.Executor, nodeID types.NodeID) (ID, error)

func NewID

func NewID(db sql.Executor) (ID, error)

NewID returns a new unique ID for a marriage. The ID is unique across all marriages. Use within a transaction to ensure that the returned ID is not used by another routine.

type Info

type Info struct {
	ID            ID
	NodeID        types.NodeID
	ATX           types.ATXID
	MarriageIndex int
	Target        types.NodeID
	Signature     types.EdSignature
}

func FindByNodeID

func FindByNodeID(db sql.Executor, nodeID types.NodeID) (Info, error)

Jump to

Keyboard shortcuts

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