diff options
Diffstat (limited to 'app/models/oauth_client.go')
-rw-r--r-- | app/models/oauth_client.go | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/app/models/oauth_client.go b/app/models/oauth_client.go new file mode 100644 index 0000000..2f30087 --- /dev/null +++ b/app/models/oauth_client.go | |||
@@ -0,0 +1,27 @@ | |||
1 | package models | ||
2 | |||
3 | import ( | ||
4 | "context" | ||
5 | "time" | ||
6 | ) | ||
7 | |||
8 | type OauthClient struct { | ||
9 | Id string `bson:"_id"` | ||
10 | Deleted *time.Time | ||
11 | } | ||
12 | |||
13 | func (c *OauthClient) RecordId() string { | ||
14 | return c.Id | ||
15 | } | ||
16 | |||
17 | func (c *OauthClient) MarkDeleted(t time.Time) { | ||
18 | c.Deleted = &t | ||
19 | } | ||
20 | |||
21 | type OauthClientStore interface { | ||
22 | List(ctx context.Context) ([]*OauthClient, error) | ||
23 | ListAll(ctx context.Context) ([]*OauthClient, error) | ||
24 | Get(ctx context.Context, name string) (*OauthClient, error) | ||
25 | Upsert(ctx context.Context, m *OauthClient) error | ||
26 | Delete(ctx context.Context, m *OauthClient) error | ||
27 | } | ||