-
Notifications
You must be signed in to change notification settings - Fork 237
/
user.go
45 lines (37 loc) · 1018 Bytes
/
user.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright 2017 Drone.IO Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package scm
import (
"context"
"time"
)
type (
// User represents a user account.
User struct {
ID string
Login string
Name string
Email string
Avatar string
Created time.Time
Updated time.Time
}
// Email represents a user email.
Email struct {
Value string
Primary bool
Verified bool
}
// UserService provides access to user account resources.
UserService interface {
// Find returns the authenticated user.
Find(context.Context) (*User, *Response, error)
// FindEmail returns the authenticated user email.
FindEmail(context.Context) (string, *Response, error)
// FindLogin returns the user account by username.
FindLogin(context.Context, string) (*User, *Response, error)
// ListEmail returns the user email list.
ListEmail(context.Context, ListOptions) ([]*Email, *Response, error)
}
)