notary

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AcceptedStatus = "Accepted"
	PendingStatus  = "Pending"
	InvalidStatus  = "Invalid"
	RejectedStatus = "Rejected"
	TimeoutStatus  = "Timeout"
)

Variables

This section is empty.

Functions

func NewSignedToken

func NewSignedToken(cfg TokenConfig) (string, error)

Types

type APIClient

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

func NewAPIClient

func NewAPIClient(token string, httpTimeout time.Duration) *APIClient

type Payload

type Payload struct {
	*bytes.Reader // zip file with the binary
	Path          string
	Digest        string
}

func NewPayload

func NewPayload(path string) (*Payload, error)

type StatusConfig

type StatusConfig struct {
	Timeout time.Duration
	Poll    time.Duration
	Wait    bool
	// contains filtered or unexported fields
}

func (*StatusConfig) WithProgress

func (c *StatusConfig) WithProgress(stage *progress.Stage) *StatusConfig

type Submission

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

func ExistingSubmission

func ExistingSubmission(a api, id string) *Submission

func NewSubmission

func NewSubmission(a api, bin *Payload) *Submission

func (Submission) ID

func (s Submission) ID() string

func (Submission) List

func (s Submission) List(ctx context.Context) ([]SubmissionList, error)

func (Submission) Logs

func (s Submission) Logs(ctx context.Context) (string, error)

func (*Submission) Start

func (s *Submission) Start(ctx context.Context) error

func (Submission) Status

func (s Submission) Status(ctx context.Context) (SubmissionStatus, error)

type SubmissionList

type SubmissionList struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Status      string `json:"status"`
	CreatedDate string `json:"createdDate"`
}

type SubmissionStatus

type SubmissionStatus string

func PollStatus

func PollStatus(ctx context.Context, sub *Submission, cfg StatusConfig) (SubmissionStatus, error)

type TokenConfig

type TokenConfig struct {
	Issuer        string
	PrivateKeyID  string
	TokenLifetime time.Duration
	PrivateKey    string
}

Jump to

Keyboard shortcuts

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