Documentation ¶
Index ¶
- func EntryIDFromKey(key string) util.OID
- func EntryKey(ID util.OID) string
- func FileBlobKey(ID util.OID) string
- func FileIDFromKey(key string) util.OID
- func FileKey(ID util.OID) string
- func InitIndex(DB *buntdb.DB)
- func SecretKey(ID util.OID) string
- func ShareIDFromKey(key string) util.OID
- func ShareKey(ID util.OID) string
- func TeamIDFromKey(key string) util.OID
- func TeamKey(ID util.OID) string
- func UserKey(name string) string
- type Entry
- func (e *Entry) AddFile(fileID string) bool
- func (e *Entry) AddSecret(secretID string) bool
- func (e *Entry) HasFile(fileID string) bool
- func (e *Entry) HasSecret(secretID string) bool
- func (e *Entry) RemoveFile(fileID string) bool
- func (e *Entry) RemoveSecret(secretID string) bool
- func (e *Entry) Result(ID util.OID, secrets []*SecretResult, shares []*ShareResult) *EntryResult
- func (e *Entry) String() string
- func (e *Entry) Summary(ID util.OID) *EntrySum
- type EntryResult
- type EntrySum
- type File
- type FileBlob
- type FileResult
- type Secret
- type SecretResult
- type Share
- type ShareResult
- type StringSlice
- type Team
- type TeamResult
- type User
- type UserResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EntryIDFromKey ¶
EntryIDFromKey returns entry' ID from key
func FileIDFromKey ¶
FileIDFromKey returns file' ID from key
func ShareIDFromKey ¶
ShareIDFromKey returns share' ID from key
func TeamIDFromKey ¶
TeamIDFromKey returns team' ID from key
Types ¶
type Entry ¶
type Entry struct { TeamID util.OID `json:"teamID"` Name string `json:"name"` Category string `json:"category"` Priority int `json:"priority"` IsDeleted bool `json:"isDeleted"` Secrets []string `json:"secrets"` Files []string `json:"files"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` }
Entry represents entry info
func (*Entry) RemoveFile ¶
RemoveFile removes the file from the entry
func (*Entry) RemoveSecret ¶
RemoveSecret removes the secret from the entry
func (*Entry) Result ¶
func (e *Entry) Result(ID util.OID, secrets []*SecretResult, shares []*ShareResult) *EntryResult
Result returns EntryResult intance
type EntryResult ¶
type EntryResult struct { ID util.OID `json:"id"` TeamID util.OID `json:"teamID"` Name string `json:"name"` Category string `json:"category"` Priority int `json:"priority"` Secrets []*SecretResult `json:"secrets"` Files []*FileResult `json:"files"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` }
EntryResult represents desensitized entry
func (*EntryResult) String ¶
func (e *EntryResult) String() string
String returns JSON string with desensitized entry info
type EntrySum ¶
type EntrySum struct { ID util.OID `json:"id"` TeamID util.OID `json:"teamID"` Name string `json:"name"` Category string `json:"category"` Priority int `json:"priority"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` }
EntrySum represents desensitized entry
type File ¶
type File struct { Name string `json:"name"` UserID string `json:"userID"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` }
File represents file
type FileBlob ¶
type FileBlob []byte // binary data encoded with base64, size <= 100KB
FileBlob ...
func FileBlobFromString ¶
FileBlobFromString ...
type FileResult ¶
type FileResult struct { ID util.OID `json:"id"` UserID string `json:"userID"` Name string `json:"name"` Signed string `json:"signed"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` }
FileResult represents file info
type Secret ¶
type Secret struct { Name string `json:"name"` URL string `json:"url"` Pass string `json:"password"` Note string `json:"note"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` }
Secret represents secret info
func SecretFrom ¶
SecretFrom parse JSON string and returns a Secret intance.
type SecretResult ¶
type SecretResult struct { ID util.OID `json:"id"` Name string `json:"name"` URL string `json:"url"` Pass string `json:"password"` Note string `json:"note"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` }
SecretResult represents secret info
func (*SecretResult) String ¶
func (s *SecretResult) String() string
String returns JSON string with full secret info
type Share ¶
type Share struct {}
Share represents share info
type StringSlice ¶
type StringSlice []string
StringSlice ...
func (StringSlice) Add ¶
func (s StringSlice) Add(str string) ([]string, bool)
Add adds the str to the slice.
func (StringSlice) Has ¶
func (s StringSlice) Has(str string) bool
Has returns whether the str is in the slice.
type Team ¶
type Team struct { Logo util.OID `json:"logo"` UserID string `json:"userID"` Name string `json:"name"` Pass string `json:"pass"` IsFrozen bool `json:"isFrozen"` // if true, member can't modify team's entires IsDeleted bool `json:"isDeleted"` Visibility string `json:"visibility"` // enum: "private", "member" Members []string `json:"members"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` }
Team represents team info
func (*Team) RemoveMember ¶
RemoveMember removes the user from team's members
type TeamResult ¶
type TeamResult struct { ID util.OID `json:"id"` Logo util.OID `json:"logo"` UserID string `json:"userID"` Name string `json:"name"` IsFrozen bool `json:"isFrozen"` IsPrivate bool `json:"IsPrivate"` Visibility string `json:"visibility"` Members []string `json:"members"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` }
TeamResult represents desensitized team
func (*TeamResult) String ¶
func (t *TeamResult) String() string
String returns JSON string with desensitized team info
type User ¶
type User struct { ID string `json:"id"` Pass string `json:"pass"` // encrypt Avatar util.OID `json:"avatar"` IsBlocked bool `json:"isBlocked"` Attempt int `json:"attempt"` // login attempts Created time.Time `json:"created"` Updated time.Time `json:"updated"` }
User represents user info
type UserResult ¶
type UserResult struct { ID string `json:"id"` Avatar util.OID `json:"avatar"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` }
UserResult represents desensitized user
func (*UserResult) String ¶
func (u *UserResult) String() string
String returns JSON string with desensitized user info