Documentation ¶
Index ¶
- type Getter
- type Option
- type Server
- func (s *Server) AllArtifactsHandler(w http.ResponseWriter, r *http.Request)
- func (s *Server) ArtifactAllVersionsHandler(w http.ResponseWriter, r *http.Request)
- func (s *Server) ArtifactVersionHandler(w http.ResponseWriter, r *http.Request)
- func (s *Server) Download(ctx context.Context, gitoid string) (io.ReadCloser, error)
- func (s *Server) DownloadArtifactHandler(w http.ResponseWriter, r *http.Request)
- func (s *Server) DownloadHandler(w http.ResponseWriter, r *http.Request)
- func (s *Server) Query(sqlclient *ent.Client) *handler.Server
- func (s *Server) Router() *mux.Router
- func (s *Server) Upload(ctx context.Context, r io.Reader) (api.UploadResponse, error)
- func (s *Server) UploadHandler(w http.ResponseWriter, r *http.Request)
- type Storer
- type StorerGetter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 WithMetadataStore ¶ added in v0.4.0
func WithObjectStore ¶ added in v0.4.0
func WithObjectStore(objectStore StorerGetter) Option
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
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
@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
@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
@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
@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