Documentation
¶
Index ¶
- Constants
- Variables
- func IsNotFound(err error) bool
- type Client
- func (cli Client) Commit(ctx context.Context, commit *Commit) error
- func (cli Client) DeleteObject(ctx context.Context, storeID string, objectID string) error
- func (cli Client) DeleteUploader(ctx context.Context, id string) error
- func (cli Client) GetContent(ctx context.Context, storeID, objectID, digest string) (*Content, error)
- func (cli Client) GetContentPath(ctx context.Context, storeID, objectID, contentPath string) (*Content, error)
- func (cli Client) GetObjectManifest(ctx context.Context, storeID string, objectID string) (*ObjectManifest, error)
- func (cli Client) GetObjectVersion(ctx context.Context, storeID string, objectID string, ver int) (*ObjectVersion, error)
- func (cli Client) GetUploader(ctx context.Context, id string) (up *Uploader, err error)
- func (cli Client) ListUploaders(ctx context.Context) ([]UploaderListItem, error)
- func (cli Client) NewUploader(ctx context.Context, algs []string, desc string) (up *Uploader, err error)
- func (cli Client) Upload(ctx context.Context, uploadPath string, r io.Reader) (result Upload, err error)
- type Commit
- type Content
- type FileInfo
- type Manifest
- type ObjectManifest
- type ObjectRef
- type ObjectVersion
- type Upload
- type Uploader
- type UploaderListItem
- type UploaderRef
Constants ¶
const ( RouteDownload = "/" + chapv1connect.AccessServiceName + "/" + "download" RouteUpload = `/` + chapv1connect.CommitServiceName + "/" + "upload" QueryDigest = "digest" QueryContentPath = "content_path" QueryObjectID = "object_id" QueryUploaderID = "uploader" QueryStorageRoot = "storage_root" )
http routes for upload/download
Variables ¶
var CODE_VERSION = func() string { if info, ok := debug.ReadBuildInfo(); ok { revision := "" localmods := false for _, setting := range info.Settings { switch setting.Key { case "vcs.revision": revision = setting.Value case "vcs.modified": localmods = setting.Value == "true" } } if !localmods { return revision } } return "none" }()
var VERSION string
VERSION is set with ldflags -X
Functions ¶
func IsNotFound ¶
Types ¶
type Client ¶
func (Client) Commit ¶
CommitFork creates or updates an object using an existing object as its content source. If the commit's state is empty, then the source object's current version state is used. If srcStore is empty strings, commit.GroupID and commit.StorageRootID are used.
func (Client) DeleteObject ¶
func (Client) DeleteUploader ¶
func (Client) GetContent ¶
func (cli Client) GetContent(ctx context.Context, storeID, objectID, digest string) (*Content, error)
Download
func (Client) GetContentPath ¶
func (Client) GetObjectManifest ¶
func (Client) GetObjectVersion ¶
func (Client) GetUploader ¶
func (Client) ListUploaders ¶
func (cli Client) ListUploaders(ctx context.Context) ([]UploaderListItem, error)
func (Client) NewUploader ¶
type Content ¶
type Content struct {
io.ReadCloser
Size int64
}
type ObjectManifest ¶
type ObjectManifest struct {
ObjectRef
Path string
Spec string
DigestAlgorithm string
Manifest Manifest
}
ObjectManifest corresponds to GetObjectManifestResponse proto
type ObjectVersion ¶
type ObjectVersion struct {
ObjectRef
Spec string
Version int
Head int
DigestAlgorithm string
State Manifest
Message string
User *ocfl.User
Created time.Time
}
ObjectVersion corresponds to GetObjectVersionResponse proto
type UploaderListItem ¶
type UploaderListItem struct {
UploaderRef
Created time.Time
UserID string
Description string
}
type UploaderRef ¶
type UploaderRef struct {
ID string `json:"uploader_id"`
}