server

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Getter

type Getter interface {
	Get(context.Context, string) (io.ReadCloser, error)
}

type Option added in v0.4.0

type Option func(*Server)

func WithArtifactStore added in v0.4.0

func WithArtifactStore(wds artifactstore.Store) Option

func WithEntSqlClient added in v0.4.0

func WithEntSqlClient(sqlClient *ent.Client) Option

func WithMetadataStore added in v0.4.0

func WithMetadataStore(metadataStore Storer) Option

func WithObjectStore added in v0.4.0

func WithObjectStore(objectStore StorerGetter) Option

type Server

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

func New

func New(cfg *config.Config, opts ...Option) (Server, error)

func (*Server) AllArtifactsHandler added in v0.4.0

func (s *Server) AllArtifactsHandler(w http.ResponseWriter, r *http.Request)

@Summary List all Artifacts @Description retrieves details about all available Artifacts @Produce json @Success 200 {object} map[string]artifactstore.Artifact @Failure 500 {object} string @Failure 400 {object} string @Tags Artifacts @Router /v1/artifacts [get]

func (*Server) ArtifactAllVersionsHandler added in v0.4.0

func (s *Server) ArtifactAllVersionsHandler(w http.ResponseWriter, r *http.Request)

@Summary List Artifact Versions @Description retrieves details about all available versions of a specified artifact @Produce json @Param name path string true "artifact name" @Success 200 {object} map[string]artifactstore.Version @Failure 500 {object} string @Failure 400 {object} string @Tags Artifacts @Router /v1/artifacts/{name} [get]

func (*Server) ArtifactVersionHandler added in v0.4.0

func (s *Server) ArtifactVersionHandler(w http.ResponseWriter, r *http.Request)

@Summary Artifact Version Details @Description retrieves details about a specified version of an artifact @Produce json @Param name path string true "artifact name" @Param version path string true "version of artifact" @Success 200 {object} artifactstore.Version @Failure 500 {objecpec} string @Failure 404 {object} nil @Failure 400 {object} string @Tags Artifacts @Router /v1/artifacts/{name}/{version} [get]

func (*Server) Download added in v0.4.0

func (s *Server) Download(ctx context.Context, gitoid string) (io.ReadCloser, error)

@Summary Download @Description download an attestation @Produce json @Param gitoid path string true "gitoid" @Success 200 {object} dsse.Envelope @Failure 500 {object} string @Failure 404 {object} nil @Failure 400 {object} string @Tags attestation @Router /v1/download/{gitoid} [get]

func (*Server) DownloadArtifactHandler added in v0.4.0

func (s *Server) DownloadArtifactHandler(w http.ResponseWriter, r *http.Request)

@Summary Download Artifact @Description downloads a specified distribution of an artifact @Produce octet-stream @Param name path string true "name of artifact" @Param version path string true "version of artifact to download" @Param distribution path string true "distribution of artifact to download" @Success 200 {file} octet-stream @Failure 500 {object} string @Failure 404 {object} nil @Failure 400 {object} string @Tags Artifacts @Router /v1/download/artifact/{name}/{version}/{distribution} [get]

func (*Server) DownloadHandler added in v0.4.0

func (s *Server) DownloadHandler(w http.ResponseWriter, r *http.Request)

@Summary Download @Description download an attestation @Produce json @Param gitoid path string true "gitoid" @Success 200 {object} dsse.Envelope @Failure 500 {object} string @Failure 404 {object} nil @Failure 400 {object} string @Deprecated @Router /download/{gitoid} [get]

func (*Server) Query added in v0.4.0

func (s *Server) Query(sqlclient *ent.Client) *handler.Server

@Summary Query GraphQL @Description GraphQL query @Produce json @Success 200 {object} archivista.Resolver @Tags graphql @Router /v1/query [post]

func (*Server) Router added in v0.4.0

func (s *Server) Router() *mux.Router

@title Archivista API @description Archivista API @version v1 @contact.name Archivista Contributors @contact.url https://github.com/in-toto/archivista/issues/new @license Apache 2 @license.url https://opensource.org/licenses/Apache-2 InitRoutes initializes the HTTP API routes for the server

func (*Server) Upload added in v0.4.0

func (s *Server) Upload(ctx context.Context, r io.Reader) (api.UploadResponse, error)

@Summary Upload @Description stores an attestation @Produce json @Success 200 {object} api.StoreResponse @Tags attestation @Router /v1/upload [post]

func (*Server) UploadHandler added in v0.4.0

func (s *Server) UploadHandler(w http.ResponseWriter, r *http.Request)

@Summary Upload @Description stores an attestation @Produce json @Success 200 {object} api.StoreResponse @Router /upload [post] @Deprecated

type Storer

type Storer interface {
	Store(context.Context, string, []byte) error
}

type StorerGetter

type StorerGetter interface {
	Storer
	Getter
}

Jump to

Keyboard shortcuts

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