Documentation ¶
Index ¶
- type ArchivistaService
- 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 Service
- type Storer
- type StorerGetter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArchivistaService ¶
type ArchivistaService struct { Ctx context.Context // context for the service Cfg *config.Config // configuration for the service (if none it uses environment variables) // contains filtered or unexported fields }
ArchivistaService is the implementation of the Archivista service
func (*ArchivistaService) GetFileStoreCh ¶
func (a *ArchivistaService) GetFileStoreCh() <-chan error
GetFileStoreCh returns the file store channel
func (*ArchivistaService) GetSQLStoreCh ¶
func (a *ArchivistaService) GetSQLStoreCh() <-chan error
GetSQLStoreCh returns the SQL store channel
func (*ArchivistaService) Setup ¶
func (a *ArchivistaService) Setup() (*Server, error)
Setup Archivista Service
type Option ¶
type Option func(*Server)
func WithArtifactStore ¶
func WithArtifactStore(wds artifactstore.Store) Option
func WithEntSqlClient ¶
func WithMetadataStore ¶
func WithObjectStore ¶
func WithObjectStore(objectStore StorerGetter) Option
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) AllArtifactsHandler ¶
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 ¶
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 ¶
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 ¶
@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 ¶
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 ¶
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 ¶
@Summary Query GraphQL @Description GraphQL query @Produce json @Success 200 {object} archivista.Resolver @Tags graphql @Router /v1/query [post]
func (*Server) Router ¶
@title Archivista API @description Archivista API @version v1 @contact.name Archivista Contributors @contact.url https://github.com/ramidij/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 ¶
@Summary Upload @Description stores an attestation @Produce json @Success 200 {object} api.StoreResponse @Tags attestation @Router /v1/upload [post]
func (*Server) UploadHandler ¶
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 Service ¶
type Service interface { Setup() (Server, error) GetConfig() *config.Config GetFileStoreCh() chan error GetSQLStoreCh() chan error }
Service is the interface for the Archivista service