observation

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanonicalURI

func CanonicalURI(uri string) string

func IsEnforced

func IsEnforced(ctx context.Context) bool

func VerifyCurrent

func VerifyCurrent(ctx context.Context, uri string, data []byte) error

func WithState

func WithState(ctx context.Context) context.Context

Types

type Metadata

type Metadata struct {
	Token           string `json:"token"`
	SHA256          string `json:"sha256"`
	Size            int    `json:"size"`
	ContentComplete bool   `json:"contentComplete"`
	ObservedAt      string `json:"observedAt,omitempty"`
}

func MetadataFor

func MetadataFor(data []byte, contentComplete bool, observedAt time.Time) Metadata

func RecordRead

func RecordRead(ctx context.Context, uri string, data []byte, contentComplete bool) Metadata

type Record

type Record struct {
	URI        string
	Canonical  string
	SHA256     string
	Size       int
	ObservedAt string
}

type State

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

func StateFromContext

func StateFromContext(ctx context.Context) *State

Jump to

Keyboard shortcuts

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