Browse Source

v2 API updates.

master
Benjamin Shelton 4 months ago
parent
commit
5730583a3c
2 changed files with 27 additions and 9 deletions
  1. +13
    -1
      v2/api/keys.go
  2. +14
    -8
      v2/keystar.go

+ 13
- 1
v2/api/keys.go View File

@ -2,4 +2,16 @@ package api
type Key interface {
Bytes() []byte
}
}
type KeyRing interface {
AddKey(name string, key Key) (Key, error)
DeleteKey(name string) error
ReadKey(name string) (Key, error)
}
type Session interface {
KeyRing
CreateKeyRing(name string) (KeyRing, error)
LoadKeyRing(name string) (KeyRing, error)
}

+ 14
- 8
v2/keystar.go View File

@ -18,21 +18,27 @@ func New() {
}
type session struct {
defaultKeyRing string
// Include storage fields, default keyring, etc.
}
func (s *session) CreateKeyRing(name string) {
func (s *session) CreateKeyRing(name string) (api.KeyRing, error) {
return nil, nil
}
func (s *session) AddKey(name string, key api.Key) {
func (s *session) LoadKeyRing(name string) (api.KeyRing, error) {
return nil, nil
}
func (s *session) DeleteKey(name string) {
func (s *session) AddKey(name string, key api.Key) (api.Key, error) {
return nil, nil
}
func (s *session) ReadKey(name string) {
func (s *session) DeleteKey(name string) error {
return nil
}
}
func (s *session) ReadKey(name string) (api.Key, error) {
return nil, nil
}

Loading…
Cancel
Save