Documentation ¶
Index ¶
- Constants
- type API
- func (a *API) ApplyUpdatersToUserByID(userID string, updaters []UserUpdater) (*User, error)
- func (a *API) ApplyUpdatersToUserByObject(user *User, updaters []UserUpdater) (*User, error)
- func (a *API) CheckToken(token string) (*Token, error)
- func (a *API) DeleteDataset(datasetID string) error
- func (a *API) DeleteUserByID(userID string, password string) error
- func (a *API) FindUsers(query *UsersQuery) (Users, error)
- func (a *API) GetUserByEmail(email string) (*User, error)
- func (a *API) GetUserByID(userID string) (*User, error)
- func (a *API) IsSessionUserID(userID string) bool
- func (a *API) ListDatasets(userID string, filter *Filter, pagination *Pagination) (*ResponseArray, error)
- func (a *API) Login(email string, password string) (*User, error)
- func (a *API) Logout() error
- func (a *API) RefreshToken() (*Token, error)
- func (a *API) ServerLogin() error
- func (a *API) UpdateUserByID(userID string, userUpdates *UserUpdates) (*User, error)
- func (a *API) UpdateUserByObject(user *User, userUpdates *UserUpdates) (*User, error)
- type AddRolesUserUpdater
- type Error
- type Filter
- type Meta
- type Pagination
- type RemoveRolesUserUpdater
- type ResponseArray
- type ResponseObject
- type Session
- type Source
- type Token
- type Trace
- type User
- type UserDelete
- type UserUpdater
- type UserUpdates
- type Users
- type UsersQuery
Constants ¶
View Source
const ( ConfigDirectoryName = ".tidepool" SessionFileName = "session" )
View Source
const ( TidepoolServerName = "X-Tidepool-Server-Name" TidepoolServerSecret = "X-Tidepool-Server-Secret" TidepoolSessionToken = "X-Tidepool-Session-Token" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct { Name string Endpoint string Writer io.Writer Verbose bool // contains filtered or unexported fields }
func (*API) ApplyUpdatersToUserByID ¶ added in v1.2.0
func (a *API) ApplyUpdatersToUserByID(userID string, updaters []UserUpdater) (*User, error)
func (*API) ApplyUpdatersToUserByObject ¶ added in v1.2.0
func (a *API) ApplyUpdatersToUserByObject(user *User, updaters []UserUpdater) (*User, error)
func (*API) DeleteDataset ¶
func (*API) DeleteUserByID ¶ added in v1.2.0
func (*API) GetUserByEmail ¶ added in v1.2.0
func (*API) IsSessionUserID ¶ added in v1.2.0
func (*API) ListDatasets ¶
func (a *API) ListDatasets(userID string, filter *Filter, pagination *Pagination) (*ResponseArray, error)
func (*API) RefreshToken ¶
func (*API) ServerLogin ¶
func (*API) UpdateUserByID ¶ added in v1.2.0
func (a *API) UpdateUserByID(userID string, userUpdates *UserUpdates) (*User, error)
func (*API) UpdateUserByObject ¶ added in v1.2.0
func (a *API) UpdateUserByObject(user *User, userUpdates *UserUpdates) (*User, error)
type AddRolesUserUpdater ¶ added in v1.2.0
type AddRolesUserUpdater struct {
Roles []string
}
func NewAddRolesUserUpdater ¶ added in v1.2.0
func NewAddRolesUserUpdater(roles []string) (*AddRolesUserUpdater, error)
func (*AddRolesUserUpdater) Update ¶ added in v1.2.0
func (u *AddRolesUserUpdater) Update(user *User, userUpdates *UserUpdates) error
type Pagination ¶
type RemoveRolesUserUpdater ¶ added in v1.2.0
type RemoveRolesUserUpdater struct {
Roles []string
}
func NewRemoveRolesUserUpdater ¶ added in v1.2.0
func NewRemoveRolesUserUpdater(roles []string) (*RemoveRolesUserUpdater, error)
func (*RemoveRolesUserUpdater) Update ¶ added in v1.2.0
func (u *RemoveRolesUserUpdater) Update(user *User, userUpdates *UserUpdates) error
type ResponseArray ¶
type ResponseObject ¶
type User ¶
type User struct { ID string `json:"userid,omitempty"` Username string `json:"username,omitempty"` Emails []string `json:"emails,omitempty"` Roles []string `json:"roles,omitempty"` TermsAccepted string `json:"termsAccepted,omitempty"` EmailVerified bool `json:"emailVerified,omitempty"` PasswordExists bool `json:"passwordExists,omitempty"` }
type UserDelete ¶ added in v1.2.0
type UserDelete struct {
Password *string `json:"password,omitempty"`
}
type UserUpdater ¶ added in v1.2.0
type UserUpdater interface {
Update(user *User, userUpdates *UserUpdates) error
}
type UserUpdates ¶ added in v1.2.0
type UserUpdates struct { Username *string `json:"username,omitempty"` Emails *[]string `json:"emails,omitempty"` Password *string `json:"password,omitempty"` Roles *[]string `json:"roles,omitempty"` TermsAccepted *string `json:"termsAccepted,omitempty"` EmailVerified *bool `json:"emailVerified,omitempty"` }
func (*UserUpdates) HasUpdates ¶ added in v1.2.0
func (u *UserUpdates) HasUpdates() bool
type UsersQuery ¶ added in v1.2.0
type UsersQuery struct {
Role *string `json:"role,omitempty"`
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.