Documentation ¶
Index ¶
- Constants
- func Commit(t **datastore.Transaction) error
- func GenerateSid(rng *rand.Rand) (string, error)
- func GenerateUid(rng *rand.Rand) (string, error)
- func Rollback(t **datastore.Transaction)
- type Architecture
- type Artifact
- type DownloadHandler
- type Flags
- type ListHandler
- type Modifier
- func WithBucket(bucket string) Modifier
- func WithCredentialsFile(path string) Modifier
- func WithCredentialsJSON(json []byte) Modifier
- func WithFlags(flags *Flags) Modifier
- func WithLogger(log logger.Logger) Modifier
- func WithProjectID(prid string) Modifier
- func WithProjectIDFile(path string) Modifier
- func WithProjectIDJSON(data []byte) Modifier
- func WithPublishBaseURL(url string) Modifier
- func WithSigningConfig(path string) Modifier
- func WithSigningJSON(data []byte) Modifier
- func WithValidity(d time.Duration) Modifier
- type Options
- type PathElement
- type Published
- type Server
- func (s *Server) Commit(ctx context.Context, req *astore.CommitRequest) (*astore.CommitResponse, error)
- func (s *Server) Delete(ctx context.Context, request *astore.DeleteRequest) (*astore.DeleteResponse, error)
- func (s *Server) DownloadArtifact(prefix string, ehandler DownloadHandler, w http.ResponseWriter, ...)
- func (s *Server) DownloadPublished(prefix string, ehandler DownloadHandler, w http.ResponseWriter, ...)
- func (s *Server) List(ctx context.Context, req *astore.ListRequest) (*astore.ListResponse, error)
- func (s *Server) ListPublished(prefix string, ehandler ListHandler, w http.ResponseWriter, r *http.Request)
- func (s *Server) Note(ctx context.Context, req *astore.NoteRequest) (*astore.NoteResponse, error)
- func (s *Server) Publish(ctx context.Context, req *astore.PublishRequest) (*astore.PublishResponse, error)
- func (s *Server) Retrieve(ctx context.Context, req *astore.RetrieveRequest) (*astore.RetrieveResponse, error)
- func (s *Server) Store(ctx context.Context, req *astore.StoreRequest) (*astore.StoreResponse, error)
- func (s *Server) Tag(ctx context.Context, req *astore.TagRequest) (*astore.TagResponse, error)
- func (s *Server) Unpublish(ctx context.Context, req *astore.UnpublishRequest) (*astore.UnpublishResponse, error)
Constants ¶
View Source
const KindArchitecture = "Arch"
View Source
const KindArtifact = "Artifact"
View Source
const KindPathElement = "Pel"
View Source
const KindPublished = "Pub"
Variables ¶
This section is empty.
Functions ¶
func Commit ¶
func Commit(t **datastore.Transaction) error
func GenerateSid ¶
GenerateSid generates a path where to store the file.
func GenerateUid ¶
GenerateUid generates a unique identifier for the metadata.
func Rollback ¶
func Rollback(t **datastore.Transaction)
Types ¶
type Artifact ¶
type DownloadHandler ¶
type DownloadHandler func(string, *astore.RetrieveResponse, error, http.ResponseWriter, *http.Request)
type Flags ¶
type Flags struct { Bucket string ProjectID string SignatureValidity time.Duration PublishBaseURL string ProjectIDJSON []byte SigningConfigJSON []byte CredentialsFileJSON []byte }
func DefaultFlags ¶
func DefaultFlags() *Flags
type ListHandler ¶
type ListHandler func(string, *astore.ListResponse, error, http.ResponseWriter, *http.Request)
type Modifier ¶
func WithBucket ¶
func WithCredentialsFile ¶
func WithCredentialsJSON ¶
func WithLogger ¶
func WithProjectID ¶
func WithProjectIDFile ¶
func WithProjectIDJSON ¶
func WithPublishBaseURL ¶
func WithSigningConfig ¶
func WithSigningJSON ¶
func WithValidity ¶
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
func DefaultOptions ¶
func DefaultOptions() Options
func (*Options) ForSigning ¶
func (o *Options) ForSigning(method string) *storage.SignedURLOptions
type Published ¶
type Published struct { Parent string Creator string Created time.Time // Fields from RetrieveRequest. Uid string Path string Architecture string // When converting this to a query, no tags vs empty tag array have different meanings: // The former indicates that the client specified no tags to filter by. // The latter indicates that the client is looking for artifacts with no tags assigned. // // We flatten the struct here, so we use a bool to differentiate between the two cases. HasTags bool Tag []string }
func FromListRequest ¶
func FromListRequest(req *astore.ListRequest, pub *Published) *Published
func FromRetrieveRequest ¶
func FromRetrieveRequest(req *astore.RetrieveRequest, pub *Published) *Published
func (*Published) ToListRequest ¶
func (pub *Published) ToListRequest() *astore.ListRequest
func (*Published) ToRetrieveRequest ¶
func (pub *Published) ToRetrieveRequest() *astore.RetrieveRequest
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) Commit ¶
func (s *Server) Commit(ctx context.Context, req *astore.CommitRequest) (*astore.CommitResponse, error)
func (*Server) Delete ¶
func (s *Server) Delete(ctx context.Context, request *astore.DeleteRequest) (*astore.DeleteResponse, error)
func (*Server) DownloadArtifact ¶
func (s *Server) DownloadArtifact(prefix string, ehandler DownloadHandler, w http.ResponseWriter, r *http.Request)
DownalodArtifact turns an http.Request into an astore.RetrieveRequest, executes it, and invokes the specified handler with the result.
func (*Server) DownloadPublished ¶
func (s *Server) DownloadPublished(prefix string, ehandler DownloadHandler, w http.ResponseWriter, r *http.Request)
func (*Server) List ¶
func (s *Server) List(ctx context.Context, req *astore.ListRequest) (*astore.ListResponse, error)
func (*Server) ListPublished ¶
func (s *Server) ListPublished(prefix string, ehandler ListHandler, w http.ResponseWriter, r *http.Request)
func (*Server) Note ¶
func (s *Server) Note(ctx context.Context, req *astore.NoteRequest) (*astore.NoteResponse, error)
func (*Server) Publish ¶
func (s *Server) Publish(ctx context.Context, req *astore.PublishRequest) (*astore.PublishResponse, error)
func (*Server) Retrieve ¶
func (s *Server) Retrieve(ctx context.Context, req *astore.RetrieveRequest) (*astore.RetrieveResponse, error)
func (*Server) Store ¶
func (s *Server) Store(ctx context.Context, req *astore.StoreRequest) (*astore.StoreResponse, error)
func (*Server) Tag ¶
func (s *Server) Tag(ctx context.Context, req *astore.TagRequest) (*astore.TagResponse, error)
func (*Server) Unpublish ¶
func (s *Server) Unpublish(ctx context.Context, req *astore.UnpublishRequest) (*astore.UnpublishResponse, error)
Click to show internal directories.
Click to hide internal directories.