Documentation ¶
Index ¶
- Variables
- func DBError(err error) error
- func EntryIDFromKey(key string) uuid.UUID
- func EntryKey(id string) string
- func InitIndex()
- func Open(path string) error
- func SecretKey(id string) string
- func ShareIDFromKey(key string) uuid.UUID
- func ShareKey(id string) string
- func TeamIDFromKey(key string) uuid.UUID
- func TeamKey(id string) string
- func UserKey(name string) string
- type Entry
- type EntryResult
- type EntrySum
- type Secret
- type SecretResult
- type Share
- type ShareResult
- type StringSlice
- type Team
- type TeamResult
- type User
- type UserResult
Constants ¶
This section is empty.
Variables ¶
var ( DB *buntdb.DB DBSalt = make([]byte, 64) )
Functions ¶
func EntryIDFromKey ¶ added in v0.2.0
EntryIDFromKey returns entry' ID from key
func ShareIDFromKey ¶ added in v0.2.0
ShareIDFromKey returns share' ID from key
func TeamIDFromKey ¶ added in v0.2.0
TeamIDFromKey returns team' ID from key
Types ¶
type Entry ¶
type Entry struct { OwnerID string `json:"ownerId"` OwnerType string `json:"ownerType"` Name string `json:"name"` Category string `json:"category"` Priority int `json:"priority"` Secrets []string `json:"secrets"` IsDeleted bool `json:"isDeleted"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` }
Entry represents entry info
func (*Entry) HasSecret ¶ added in v0.2.0
HasSecret returns whether the secret is in the Entry.Secrets
func (*Entry) RemoveSecret ¶ added in v0.2.0
RemoveSecret remove the secret from the Entry.Secrets
func (*Entry) Result ¶
func (e *Entry) Result(ID uuid.UUID, secrets []*SecretResult, shares []*ShareResult) *EntryResult
Result returns EntryResult intance
type EntryResult ¶
type EntryResult struct { ID uuid.UUID `json:"uuid"` OwnerID string `json:"ownerId"` OwnerType string `json:"ownerType"` Name string `json:"name"` Category string `json:"category"` Priority int `json:"priority"` Secrets []*SecretResult `json:"secrets"` 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 uuid.UUID `json:"uuid"` 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 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 uuid.UUID `json:"uuid"` 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 ¶ added in v0.2.0
type StringSlice []string
StringSlice ...
func (StringSlice) Add ¶ added in v0.2.0
func (s StringSlice) Add(str string) ([]string, bool)
Add adds the str to the slice.
func (StringSlice) Has ¶ added in v0.2.0
func (s StringSlice) Has(str string) bool
Has returns whether the str is in the slice.
type Team ¶
type Team struct { Name string `json:"name"` Pass string `json:"pass"` IsFrozen bool `json:"isFrozen"` IsDeleted bool `json:"isDeleted"` OwnerID string `json:"ownerID"` Members []string `json:"members"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` }
Team represents team info
func (*Team) RemoveMember ¶ added in v0.2.0
RemoveMember removes the user from team's members
type TeamResult ¶
type TeamResult struct { ID uuid.UUID `json:"uuid"` Name string `json:"name"` IsFrozen bool `json:"isFrozen"` OwnerID string `json:"ownerID"` 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 IsBlocked bool `json:"isBlocked"` Attempt int `json:"attempt"` // login attempts Created time.Time `json:"created"` Updated time.Time `json:"updated"` }
User represents user info