api

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const RetrieveSubjectsQuery = `` /* 275-byte string literal not displayed */
View Source
const SearchQuery = `` /* 470-byte string literal not displayed */

Variables

This section is empty.

Functions

func Download

func Download(ctx context.Context, baseURL string, gitoid string) (dsse.Envelope, error)

func DownloadReadCloser added in v0.9.0

func DownloadReadCloser(ctx context.Context, baseURL string, gitoid string) (io.ReadCloser, error)

func DownloadReadCloserWithHTTPClient added in v0.9.0

func DownloadReadCloserWithHTTPClient(ctx context.Context, client *http.Client, baseURL string, gitoid string) (io.ReadCloser, error)

func DownloadWithWriter

func DownloadWithWriter(ctx context.Context, baseURL string, gitoid string, dst io.Writer) error

func DownloadWithWriterWithHTTPClient added in v0.9.0

func DownloadWithWriterWithHTTPClient(ctx context.Context, client *http.Client, baseURL string, gitoid string, dst io.Writer) error

func GraphQlQuery

func GraphQlQuery[TRes any, TVars any](ctx context.Context, baseUrl, query string, vars TVars) (TRes, error)

func GraphQlQueryWithHeaders added in v0.9.0

func GraphQlQueryWithHeaders[TRes any, TVars any](ctx context.Context, baseUrl, query string, vars TVars, headers map[string]string) (TRes, error)

Types

type Attestation added in v0.9.0

type Attestation struct {
	Type string `json:"type"`
}

type AttestationCollection added in v0.9.0

type AttestationCollection struct {
	Name         string        `json:"name"`
	Attestations []Attestation `json:"attestations"`
}

type DSSES added in v0.9.0

type DSSES struct {
	Edges []SearchEdge `json:"edges"`
}

type GraphQLError added in v0.9.0

type GraphQLError struct {
	Message string `json:"message"`
}

type GraphQLRequestBodyGeneric added in v0.9.0

type GraphQLRequestBodyGeneric[TVars any] struct {
	Query     string `json:"query"`
	Variables TVars  `json:"variables,omitempty"`
}

type GraphQLResponseGeneric added in v0.9.0

type GraphQLResponseGeneric[T any] struct {
	Data   T              `json:"data,omitempty"`
	Errors []GraphQLError `json:"errors,omitempty"`
}

type RetrieveSubjectResults added in v0.9.0

type RetrieveSubjectResults struct {
	Subjects Subjects `json:"subjects"`
}

type RetrieveSubjectVars added in v0.9.0

type RetrieveSubjectVars struct {
	Gitoid string `json:"gitoid"`
}

type SearchEdge added in v0.9.0

type SearchEdge struct {
	Node SearchNode `json:"node"`
}

type SearchNode added in v0.9.0

type SearchNode struct {
	GitoidSha256 string    `json:"gitoidSha256"`
	Statement    Statement `json:"statement"`
}

type SearchResults added in v0.9.0

type SearchResults struct {
	Dsses DSSES `json:"dsses"`
}

type SearchVars added in v0.9.0

type SearchVars struct {
	Algorithm string `json:"algo"`
	Digest    string `json:"digest"`
}

type Statement added in v0.9.0

type Statement struct {
	AttestationCollection AttestationCollection `json:"attestationCollections"`
}

type StoreResponse deprecated

type StoreResponse = UploadResponse

Deprecated: Use UploadResponse instead. It will be removed in version >= v0.6.0

func Store

func Store(ctx context.Context, baseURL string, envelope dsse.Envelope) (StoreResponse, error)

func StoreWithReader

func StoreWithReader(ctx context.Context, baseURL string, r io.Reader) (StoreResponse, error)

func StoreWithReaderWithHTTPClient added in v0.9.0

func StoreWithReaderWithHTTPClient(ctx context.Context, client *http.Client, baseURL string, r io.Reader) (StoreResponse, error)

type SubjectDigest added in v0.9.0

type SubjectDigest struct {
	Algorithm string `json:"algorithm"`
	Value     string `json:"value"`
}

type SubjectEdge added in v0.9.0

type SubjectEdge struct {
	Node SubjectNode `json:"node"`
}

type SubjectNode added in v0.9.0

type SubjectNode struct {
	Name           string          `json:"name"`
	SubjectDigests []SubjectDigest `json:"subjectDigests"`
}

type Subjects added in v0.9.0

type Subjects struct {
	Edges []SubjectEdge `json:"edges"`
}

type UploadResponse added in v0.4.0

type UploadResponse struct {
	Gitoid string `json:"gitoid"`
}

func Upload deprecated added in v0.4.0

func Upload(ctx context.Context, baseURL string, envelope dsse.Envelope) (UploadResponse, error)

Deprecated: Use Store instead. It will be removed in version >= v0.6.0

Jump to

Keyboard shortcuts

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