checkpoints

package
v0.0.75 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package checkpoints contains logic relating to checkpoint management for entities

Index

Constants

View Source
const V1 = "v1"

V1 is the version string for the v1 format.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckpointEnvelopeV1

type CheckpointEnvelopeV1 struct {
	Version    string       `json:"version" yaml:"version"`
	Checkpoint CheckpointV1 `json:"checkpoint" yaml:"checkpoint"`
}

CheckpointEnvelopeV1 is the top-level structure for a checkpoint in the v1 format.

func NewCheckpointV1

func NewCheckpointV1(timestamp time.Time) *CheckpointEnvelopeV1

NewCheckpointV1 creates a new CheckpointV1 with the given timestamp.

func NewCheckpointV1Now

func NewCheckpointV1Now() *CheckpointEnvelopeV1

NewCheckpointV1Now creates a new CheckpointV1 with the current time.

func (*CheckpointEnvelopeV1) ToJSON

func (c *CheckpointEnvelopeV1) ToJSON() (json.RawMessage, error)

ToJSON marshals the checkpoint to JSON.

func (*CheckpointEnvelopeV1) ToJSONorDefault

func (c *CheckpointEnvelopeV1) ToJSONorDefault(def json.RawMessage) (json.RawMessage, error)

ToJSONorDefault marshals the checkpoint to JSON or returns a default value.

func (*CheckpointEnvelopeV1) WithBranch

func (c *CheckpointEnvelopeV1) WithBranch(branch string) *CheckpointEnvelopeV1

WithBranch sets the branch on the checkpoint.

func (*CheckpointEnvelopeV1) WithCommitHash

func (c *CheckpointEnvelopeV1) WithCommitHash(commitHash string) *CheckpointEnvelopeV1

WithCommitHash sets the commit hash on the checkpoint.

func (*CheckpointEnvelopeV1) WithDigest

func (c *CheckpointEnvelopeV1) WithDigest(digest string) *CheckpointEnvelopeV1

WithDigest sets the digest on the checkpoint.

func (*CheckpointEnvelopeV1) WithHTTP

func (c *CheckpointEnvelopeV1) WithHTTP(url, method string) *CheckpointEnvelopeV1

WithHTTP sets the HTTP URL and method on the checkpoint.

func (*CheckpointEnvelopeV1) WithVersion

func (c *CheckpointEnvelopeV1) WithVersion(version string) *CheckpointEnvelopeV1

WithVersion sets the version on the checkpoint.

type CheckpointV1

type CheckpointV1 struct {
	// Timestamp is the time that the checkpoint was verified.
	Timestamp time.Time `json:"timestamp" yaml:"timestamp"`

	// CommitHash is the hash of the commit that the checkpoint is for.
	CommitHash *string `json:"commitHash,omitempty" yaml:"commitHash,omitempty"`

	// Branch is the branch of the commit that the checkpoint is for.
	Branch *string `json:"branch,omitempty" yaml:"branch,omitempty"`

	// Version is the version of the entity that the checkpoint is for.
	// This may be a container image tag, a git tag, or some other version.
	Version *string `json:"version,omitempty" yaml:"version,omitempty"`

	// Digest is the digest of the entity that the checkpoint is for.
	// This may be a container image digest, or some other digest.
	Digest *string `json:"digest,omitempty" yaml:"digest,omitempty"`

	// HTTPURL is the URL that was used to verify the entity.
	HTTPURL *string `json:"httpURL,omitempty" yaml:"httpURL,omitempty"`

	// HTTPMethod is the HTTP method that was used to verify the entity.
	HTTPMethod *string `json:"httpMethod,omitempty" yaml:"httpMethod,omitempty"`
}

CheckpointV1 is the structure for a checkpoint in the v1 format.

Jump to

Keyboard shortcuts

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