added get loop and new key type xor
This commit is contained in:
parent
8f350b4b02
commit
9e68b46346
8 changed files with 122 additions and 24 deletions
|
|
@ -83,6 +83,16 @@ func (c *Client) GetKey(ctx context.Context, id string) (key schema.Key, err err
|
|||
return
|
||||
}
|
||||
|
||||
func (c *Client) GetKeyLoop(ctx context.Context, id string) (key schema.Key, err error) {
|
||||
path := fmt.Sprintf("%s/%s", keyPath, id)
|
||||
req, err := c.c.NewRequest(ctx, "GET", path, nil)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, err = c.c.FollowRedirectLoop(req, &key, time.Second*2)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *Client) CreateKey(ctx context.Context, newKey schema.NewKey) (key schema.Key, err error) {
|
||||
buf := new(bytes.Buffer)
|
||||
path := keyPath
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue