data

package
Version: v0.0.0-...-bf368c5 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2020 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyIDLength            = sha256.Size * 2
	KeyTypeEd25519         = "ed25519"
	KeyTypeECDSA_SHA2_P256 = "ecdsa-sha2-nistp256"
)

Variables

This section is empty.

Functions

func DefaultExpires

func DefaultExpires(role string) time.Time

Types

type FileMeta

type FileMeta struct {
	Length int64            `json:"length"`
	Hashes Hashes           `json:"hashes"`
	Custom *json.RawMessage `json:"custom,omitempty"`
}

func (FileMeta) HashAlgorithms

func (f FileMeta) HashAlgorithms() []string

type Files

type Files map[string]FileMeta

type Hashes

type Hashes map[string]HexBytes

type HexBytes

type HexBytes []byte

func (HexBytes) MarshalJSON

func (b HexBytes) MarshalJSON() ([]byte, error)

func (HexBytes) String

func (b HexBytes) String() string

func (*HexBytes) UnmarshalJSON

func (b *HexBytes) UnmarshalJSON(data []byte) error

type Key

type Key struct {
	Type  string   `json:"keytype"`
	Value KeyValue `json:"keyval"`
	// contains filtered or unexported fields
}

func (*Key) ID

func (k *Key) ID() string

type KeyValue

type KeyValue struct {
	Public HexBytes `json:"public"`
}

type Role

type Role struct {
	KeyIDs    []string `json:"keyids"`
	Threshold int      `json:"threshold"`
}

type Root

type Root struct {
	Type    string           `json:"_type"`
	Version int              `json:"version"`
	Expires time.Time        `json:"expires"`
	Keys    map[string]*Key  `json:"keys"`
	Roles   map[string]*Role `json:"roles"`

	ConsistentSnapshot bool `json:"consistent_snapshot"`
}

func NewRoot

func NewRoot() *Root

type Signature

type Signature struct {
	KeyID     string   `json:"keyid"`
	Method    string   `json:"method"`
	Signature HexBytes `json:"sig"`
}

type Signed

type Signed struct {
	Signed     json.RawMessage `json:"signed"`
	Signatures []Signature     `json:"signatures"`
}

type Snapshot

type Snapshot struct {
	Type    string    `json:"_type"`
	Version int       `json:"version"`
	Expires time.Time `json:"expires"`
	Meta    Files     `json:"meta"`
}

func NewSnapshot

func NewSnapshot() *Snapshot

type Targets

type Targets struct {
	Type    string    `json:"_type"`
	Version int       `json:"version"`
	Expires time.Time `json:"expires"`
	Targets Files     `json:"targets"`
}

func NewTargets

func NewTargets() *Targets

type Timestamp

type Timestamp struct {
	Type    string    `json:"_type"`
	Version int       `json:"version"`
	Expires time.Time `json:"expires"`
	Meta    Files     `json:"meta"`
}

func NewTimestamp

func NewTimestamp() *Timestamp

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL