update
This commit is contained in:
20
snapshot.go
Normal file
20
snapshot.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package main
|
||||
|
||||
import "strings"
|
||||
|
||||
type Snapshot string
|
||||
|
||||
func (s Snapshot) Path() string {
|
||||
s2 := strings.Split(string(s), `@`)
|
||||
return s2[0]
|
||||
}
|
||||
|
||||
func (s Snapshot) Name() string {
|
||||
s2 := strings.Split(string(s), `@`)
|
||||
return s2[1]
|
||||
}
|
||||
|
||||
func (s Snapshot) Append(path string) Snapshot {
|
||||
s2 := strings.Split(string(s), `@`)
|
||||
return Snapshot(s2[0] + "/" + path + "@" + s2[1])
|
||||
}
|
||||
Reference in New Issue
Block a user