auth

Paddy 2014-08-13 Parent:9a1e62c24903 Child:ceba439a0766

12:63e86d129238 Go to Latest

auth/client.go

Consistently handle context in client storage interface. Let's at least be consistent about passing or not passing context to the client storage interface. Most our methods don't take the context, so let's just remove it.

History
1 package auth
3 import (
4 "secondbit.org/uuid"
5 )
7 // Client information
8 type Client struct {
9 ID uuid.ID
10 Secret string
11 RedirectURI string
12 OwnerID uuid.ID
13 Name string
14 Logo string
15 }
17 func GetClient(id uuid.ID, ctx Context) (Client, error) {
18 // TODO: pull client from ctx
19 return Client{}, nil
20 }
22 func createClient(name, logo, redirectURI string, owner uuid.ID, ctx Context) (Client, error) {
23 // TODO: store client in ctx
24 return Client{}, nil
25 }
27 func updateClient(client *Client, name, logo, redirectURI *string, ctx Context) error {
28 // TODO: update client in ctx
29 return nil
30 }
32 func removeClient(id uuid.ID, ctx Context) error {
33 // TODO: delete client from ctx
34 return nil
35 }
37 func listClients(id uuid.ID, page, num int, ctx Context) ([]Client, error) {
38 // TODO: retrieve list of clients from ctx
39 return []Client{}, nil
40 }