chain

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorCodeRecordCountMismatch = "chain.record_count_mismatch"
	ErrorCodeHeadHashMismatch    = "chain.head_hash_mismatch"
)

Variables

This section is empty.

Functions

func Append

func Append(c *Chain, r *record.Record) error

Types

type Chain

type Chain struct {
	ChainID     string              `json:"chain_id"`
	CreatedAt   time.Time           `json:"created_at"`
	RecordCount int                 `json:"record_count"`
	HeadHash    string              `json:"head_hash,omitempty"`
	Records     []record.Record     `json:"records"`
	Signatures  []signing.Signature `json:"signatures,omitempty"`
}

func New

func New(chainID string, createdAt time.Time) *Chain

type Verification

type Verification struct {
	Intact     bool   `json:"intact"`
	Count      int    `json:"count"`
	BreakPoint string `json:"break_point,omitempty"`
	BreakIndex int    `json:"break_index,omitempty"`
	HeadHash   string `json:"head_hash,omitempty"`
}

func Verify

func Verify(c *Chain) (*Verification, error)

func VerifyRange

func VerifyRange(c *Chain, from, to time.Time) (*Verification, error)

func VerifyRangeWithOptions added in v0.5.0

func VerifyRangeWithOptions(c *Chain, from, to time.Time, opts VerifyOpts) (*Verification, error)

func VerifyWithOptions added in v0.5.0

func VerifyWithOptions(c *Chain, opts VerifyOpts) (*Verification, error)

type VerifyOpts added in v0.5.0

type VerifyOpts struct {
	Strict bool
}

Jump to

Keyboard shortcuts

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