Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

types/object: Add link support #438

Merged
merged 2 commits into from
Oct 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cmd/definitions/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions definitions/infos.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,24 @@ info "object" "meta" "etag" {
info "object" "meta" "id" {
type = "string"
export = true
comment = "ID is the unique key in service."
comment = "ID is the unique key in storage."
}
info "object" "meta" "name" {
type = "string"
export = true
comment = "Name is the relative path towards service's WorkDir."
comment = "Name is either the absolute path or the relative path towards storage's WorkDir depends on user's input."
}
info "object" "meta" "size" {
type = "int64"
}
info "object" "meta" "target" {
type = "string"
comment = "Target is the symlink target for this object, only exist when object type is link."
}
info "object" "meta" "type" {
type = "ObjectType"
export = true
comment = "Type should be one of `file`, `stream`, `dir` or `invalid`."
comment = "Type could be one of `file`, `dir`, `link` or `unknown`."
}
info "object" "meta" "updated_at" {
type = "time.Time"
Expand Down
38 changes: 33 additions & 5 deletions types/object.generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions types/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ type ObjectType string
// All available type for object.
const (
ObjectTypeFile ObjectType = "file"
ObjectTypeStream ObjectType = "stream"
ObjectTypeDir ObjectType = "dir"
ObjectTypeInvalid ObjectType = "invalid"
ObjectTypeLink ObjectType = "link"
ObjectTypeUnknown ObjectType = "unknown"
)

func NewObject(client Storager, done bool) *Object {
Expand Down