Documentation
¶
Index ¶
- type DashboardStorage
- type OAuthStorage
- func (s OAuthStorage) Clone() osin.Storage
- func (s OAuthStorage) Close()
- func (s OAuthStorage) CreateClient(c osin.Client) error
- func (s OAuthStorage) GetClient(id string) (osin.Client, error)
- func (s OAuthStorage) LoadAccess(code string) (*osin.AccessData, error)
- func (s OAuthStorage) LoadAuthorize(code string) (*osin.AuthorizeData, error)
- func (s OAuthStorage) LoadRefresh(code string) (*osin.AccessData, error)
- func (s OAuthStorage) RemoveAccess(code string) (err error)
- func (s OAuthStorage) RemoveAuthorize(code string) (err error)
- func (s OAuthStorage) RemoveClient(id string) (err error)
- func (s OAuthStorage) RemoveRefresh(code string) error
- func (s OAuthStorage) SaveAccess(data *osin.AccessData) (err error)
- func (s OAuthStorage) SaveAuthorize(data *osin.AuthorizeData) (err error)
- func (s OAuthStorage) UpdateClient(c osin.Client) error
- type ProjectStorage
- type UserStorage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DashboardStorage ¶
type DashboardStorage interface {
Create(owner, invited uint) (models.Dashboard, error)
List(userid uint) ([]models.Dashboard, error)
GetById(id string) (models.Dashboard, error)
UpdateStatus(id string, status models.Status) (models.Dashboard, error)
Delete(id string) error
}
func NewDashboardStorage ¶
func NewDashboardStorage(db *gorm.DB) DashboardStorage
type OAuthStorage ¶
type OAuthStorage struct {
// contains filtered or unexported fields
}
func (OAuthStorage) Clone ¶
func (s OAuthStorage) Clone() osin.Storage
Clone the storage if needed. For example, using mgo, you can clone the session with session.Clone to avoid concurrent access problems. This is to avoid cloning the connection at each method access. Can return itself if not a problem.
func (OAuthStorage) Close ¶
func (s OAuthStorage) Close()
Close the resources the Storage potentially holds (using Clone for example)
func (OAuthStorage) CreateClient ¶
func (s OAuthStorage) CreateClient(c osin.Client) error
CreateClient stores the client in the database and returns an error, if something went wrong.
func (OAuthStorage) GetClient ¶
func (s OAuthStorage) GetClient(id string) (osin.Client, error)
GetClient loads the client by id
func (OAuthStorage) LoadAccess ¶
func (s OAuthStorage) LoadAccess(code string) (*osin.AccessData, error)
LoadAccess retrieves access data by keys. Client information MUST be loaded together. AuthorizeData and AccessData DON'T NEED to be loaded if not easily available. Optionally can return error if expired.
func (OAuthStorage) LoadAuthorize ¶
func (s OAuthStorage) LoadAuthorize(code string) (*osin.AuthorizeData, error)
LoadAuthorize looks up AuthorizeData by a code. Client information MUST be loaded together. Optionally can return error if expired.
func (OAuthStorage) LoadRefresh ¶
func (s OAuthStorage) LoadRefresh(code string) (*osin.AccessData, error)
LoadRefresh retrieves refresh AccessData. Client information MUST be loaded together. AuthorizeData and AccessData DON'T NEED to be loaded if not easily available. Optionally can return error if expired.
func (OAuthStorage) RemoveAccess ¶
func (s OAuthStorage) RemoveAccess(code string) (err error)
RemoveAccess revokes or deletes an AccessData.
func (OAuthStorage) RemoveAuthorize ¶
func (s OAuthStorage) RemoveAuthorize(code string) (err error)
RemoveAuthorize revokes or deletes the authorization code.
func (OAuthStorage) RemoveClient ¶
func (s OAuthStorage) RemoveClient(id string) (err error)
RemoveClient removes a client (identified by id) from the database. Returns an error if something went wrong.
func (OAuthStorage) RemoveRefresh ¶
func (s OAuthStorage) RemoveRefresh(code string) error
RemoveRefresh revokes or deletes refresh AccessData.
func (OAuthStorage) SaveAccess ¶
func (s OAuthStorage) SaveAccess(data *osin.AccessData) (err error)
SaveAccess writes AccessData. If RefreshToken is not blank, it must save in a way that can be loaded using LoadRefresh.
func (OAuthStorage) SaveAuthorize ¶
func (s OAuthStorage) SaveAuthorize(data *osin.AuthorizeData) (err error)
SaveAuthorize saves authorize data.
func (OAuthStorage) UpdateClient ¶
func (s OAuthStorage) UpdateClient(c osin.Client) error
UpdateClient updates the client (identified by its id) and replaces the values with the values of client.
type ProjectStorage ¶
type ProjectStorage interface {
Create(owner, invited uint) (models.Project, error)
List(userid uint) ([]models.Project, error)
GetById(id string) (models.Project, error)
UpdateStatus(id string, status models.Status) (models.Project, error)
Delete(id string) error
}
func NewProjectStorage ¶
func NewProjectStorage(db *gorm.DB) ProjectStorage
type UserStorage ¶
type UserStorage interface {
CreateUser(email, loginType, profilePic string) (models.User, error)
GetUser(email string) (models.User, error)
}
func NewUserStorage ¶
func NewUserStorage(db *gorm.DB) UserStorage