integrity

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IntegrityChecker

type IntegrityChecker struct {
	Hash string
}

IntegrityChecker verifies configuration integrity

func NewIntegrityChecker

func NewIntegrityChecker() *IntegrityChecker

NewIntegrityChecker creates a new integrity checker

func (*IntegrityChecker) ComputeHash

func (ic *IntegrityChecker) ComputeHash(version string, data map[string]interface{}, metadata map[string]string) (string, error)

ComputeHash computes the SHA256 hash of the configuration data

func (*IntegrityChecker) Verify

func (ic *IntegrityChecker) Verify(storedHash string, version string, data map[string]interface{}, metadata map[string]string) (bool, error)

Verify verifies that the stored hash matches the computed hash

type IntegrityError

type IntegrityError struct {
	Message string
	Hash    string
	Stored  string
}

IntegrityError represents an integrity verification failure

func NewIntegrityError

func NewIntegrityError(message string, hash string, stored string) *IntegrityError

NewIntegrityError creates a new integrity error

func (*IntegrityError) Error

func (e *IntegrityError) Error() string

Error implements the error interface

Jump to

Keyboard shortcuts

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