Documentation
¶
Overview ¶
Package services ...
Package services ...
Package services ...
Package services ...
Package services ...
Package services ...
Package services ...
Package services ...
Package services ...
Index ¶
- type AllowedURI
- type AllowedURIResponse
- type Client
- type ClientResponse
- type ClientRole
- type ClientRoleResponse
- type GrantType
- type GrantTypeResponse
- type MockOauth2Service
- func (s *MockOauth2Service) AddAllowedURI(au *AllowedURI) *AllowedURIResponse
- func (s *MockOauth2Service) AddClient(client *Client) *ClientResponse
- func (s *MockOauth2Service) AddClientRole(cr *ClientRole) *ClientRoleResponse
- func (s *MockOauth2Service) AddGrantType(rd *GrantType) *GrantTypeResponse
- func (s *MockOauth2Service) AddRedirectURI(rd *RedirectURI) *RedirectURIResponse
- func (s *MockOauth2Service) AddRoleURI(ru *RoleURI) *RoleURIResponse
- func (s *MockOauth2Service) AddUser(user *User) *UserResponse
- func (s *MockOauth2Service) DeleteAllowedURI(id string) *AllowedURIResponse
- func (s *MockOauth2Service) DeleteClient(id string) *ClientResponse
- func (s *MockOauth2Service) DeleteClientRole(id string) *ClientRoleResponse
- func (s *MockOauth2Service) DeleteGrantType(id string) *GrantTypeResponse
- func (s *MockOauth2Service) DeleteRedirectURI(id string) *RedirectURIResponse
- func (s *MockOauth2Service) DeleteRoleURI(ru *RoleURI) *RoleURIResponse
- func (s *MockOauth2Service) DeleteUser(username string, clientID string) *UserResponse
- func (s *MockOauth2Service) GetAllowedURI(id string) (*AllowedURI, int)
- func (s *MockOauth2Service) GetAllowedURIList(clientID string) (*[]AllowedURI, int)
- func (s *MockOauth2Service) GetClient(clientID string) (*Client, int)
- func (s *MockOauth2Service) GetClientList() (*[]Client, int)
- func (s *MockOauth2Service) GetClientRoleList(clientID string) (*[]ClientRole, int)
- func (s *MockOauth2Service) GetGrantTypeList(clientID string) (*[]GrantType, int)
- func (s *MockOauth2Service) GetNew() Service
- func (s *MockOauth2Service) GetRedirectURIList(clientID string) (*[]RedirectURI, int)
- func (s *MockOauth2Service) GetRoleList() (*[]Role, int)
- func (s *MockOauth2Service) GetRoleURIList(uID string) (*[]RoleURI, int)
- func (s *MockOauth2Service) GetUser(username string, clientID string) (*User, int)
- func (s *MockOauth2Service) GetUserList() (*[]User, int)
- func (s *MockOauth2Service) SearchClient(client *Client) (*[]Client, int)
- func (s *MockOauth2Service) SearchUserList(clientID string) (*[]User, int)
- func (s *MockOauth2Service) SetToken(token string)
- func (s *MockOauth2Service) UpdateAllowedURI(au *AllowedURI) *AllowedURIResponse
- func (s *MockOauth2Service) UpdateClient(client *Client) *ClientResponse
- func (s *MockOauth2Service) UpdateUser(user UpdateUser) *UserResponse
- type Oauth2Service
- func (a *Oauth2Service) AddAllowedURI(au *AllowedURI) *AllowedURIResponse
- func (c *Oauth2Service) AddClient(client *Client) *ClientResponse
- func (r *Oauth2Service) AddClientRole(cr *ClientRole) *ClientRoleResponse
- func (g *Oauth2Service) AddGrantType(rd *GrantType) *GrantTypeResponse
- func (r *Oauth2Service) AddRedirectURI(rd *RedirectURI) *RedirectURIResponse
- func (r *Oauth2Service) AddRoleURI(ru *RoleURI) *RoleURIResponse
- func (u *Oauth2Service) AddUser(user *User) *UserResponse
- func (a *Oauth2Service) DeleteAllowedURI(id string) *AllowedURIResponse
- func (c *Oauth2Service) DeleteClient(id string) *ClientResponse
- func (r *Oauth2Service) DeleteClientRole(id string) *ClientRoleResponse
- func (g *Oauth2Service) DeleteGrantType(id string) *GrantTypeResponse
- func (r *Oauth2Service) DeleteRedirectURI(id string) *RedirectURIResponse
- func (r *Oauth2Service) DeleteRoleURI(ru *RoleURI) *RoleURIResponse
- func (u *Oauth2Service) DeleteUser(username string, clientID string) *UserResponse
- func (a *Oauth2Service) GetAllowedURI(id string) (*AllowedURI, int)
- func (a *Oauth2Service) GetAllowedURIList(clientID string) (*[]AllowedURI, int)
- func (c *Oauth2Service) GetClient(clientID string) (*Client, int)
- func (c *Oauth2Service) GetClientList() (*[]Client, int)
- func (r *Oauth2Service) GetClientRoleList(clientID string) (*[]ClientRole, int)
- func (g *Oauth2Service) GetGrantTypeList(clientID string) (*[]GrantType, int)
- func (s *Oauth2Service) GetNew() Service
- func (r *Oauth2Service) GetRedirectURIList(clientID string) (*[]RedirectURI, int)
- func (u *Oauth2Service) GetRoleList() (*[]Role, int)
- func (r *Oauth2Service) GetRoleURIList(uID string) (*[]RoleURI, int)
- func (u *Oauth2Service) GetUser(username string, clientID string) (*User, int)
- func (u *Oauth2Service) GetUserList() (*[]User, int)
- func (c *Oauth2Service) SearchClient(client *Client) (*[]Client, int)
- func (u *Oauth2Service) SearchUserList(clientID string) (*[]User, int)
- func (s *Oauth2Service) SetToken(token string)
- func (a *Oauth2Service) UpdateAllowedURI(au *AllowedURI) *AllowedURIResponse
- func (c *Oauth2Service) UpdateClient(client *Client) *ClientResponse
- func (u *Oauth2Service) UpdateUser(user UpdateUser) *UserResponse
- type RedirectURI
- type RedirectURIResponse
- type Role
- type RoleURI
- type RoleURIResponse
- type Service
- type UpdateUser
- type User
- type UserDis
- type UserInfo
- type UserPW
- type UserResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllowedURI ¶
type AllowedURI struct {
ID int64 `json:"id"`
URI string `json:"uri"`
ClientID int64 `json:"clientId"`
}
AllowedURI AllowedURI
type AllowedURIResponse ¶
type AllowedURIResponse struct {
Success bool `json:"success"`
ID int64 `json:"id"`
Code int `json:"code"`
}
AllowedURIResponse resp
type Client ¶
type Client struct {
ClientID int64 `json:"clientId"`
Secret string `json:"secret"`
Name string `json:"name"`
WebSite string `json:"webSite"`
Email string `json:"email"`
Enabled bool `json:"enabled"`
Paid bool `json:"paid"`
RedirectURIs []RedirectURI `json:"redirectUrls"`
}
Client client
type ClientResponse ¶
type ClientResponse struct {
Success bool `json:"success"`
ClientID int64 `json:"id"`
Code int `json:"code"`
}
ClientResponse resp
type ClientRole ¶
type ClientRole struct {
ID int64 `json:"id"`
ClientID int64 `json:"clientId"`
Role string `json:"role"`
Used bool
}
ClientRole ClientRole
type ClientRoleResponse ¶
type ClientRoleResponse struct {
Success bool `json:"success"`
ID int64 `json:"id"`
Code int `json:"code"`
}
ClientRoleResponse resp
type GrantType ¶
type GrantType struct {
ID int64 `json:"id"`
ClientID int64 `json:"clientId"`
GrantType string `json:"grantType"`
}
GrantType GrantType
type GrantTypeResponse ¶
type GrantTypeResponse struct {
Success bool `json:"success"`
ID int64 `json:"id"`
Code int `json:"code"`
}
GrantTypeResponse resp
type MockOauth2Service ¶
type MockOauth2Service struct {
Token string
ClientID string
//APIKey string
//UserID string
//Hashed string
Host string
Proxy px.Proxy
Log *lg.Logger
MockClientResponse *ClientResponse
MockClient *Client
MockClientCode int
MockClientList *[]Client
MockClientListCode int
MockAllowedURIResponse *AllowedURIResponse
MockAllowedURI *AllowedURI
MockAllowedURICode int
MockAllowedURIList *[]AllowedURI
MockAllowedURIListCode int
MockClientRoleResponse *ClientRoleResponse
MockClientRoleList *[]ClientRole
MockClientRoleListCode int
MockGrantTypeResponse *GrantTypeResponse
MockGrantTypeList *[]GrantType
MockGrantTypeListCode int
MockRedirectURIResponse *RedirectURIResponse
MockRedirectURIList *[]RedirectURI
MockRedirectURIListCode int
MockRoleURIResponse *RoleURIResponse
MockRoleURIList *[]RoleURI
MockRoleURIListCode int
MockUserResponse *UserResponse
MockUser *User
MockUserCode int
MockUserList *[]User
MockUserListCode int
MockRoleList *[]Role
MockRoleListCode int
}
MockOauth2Service MockOauth2Service
func (*MockOauth2Service) AddAllowedURI ¶
func (s *MockOauth2Service) AddAllowedURI(au *AllowedURI) *AllowedURIResponse
AddAllowedURI AddAllowedURI
func (*MockOauth2Service) AddClient ¶
func (s *MockOauth2Service) AddClient(client *Client) *ClientResponse
AddClient AddClient
func (*MockOauth2Service) AddClientRole ¶
func (s *MockOauth2Service) AddClientRole(cr *ClientRole) *ClientRoleResponse
AddClientRole AddClientRole
func (*MockOauth2Service) AddGrantType ¶
func (s *MockOauth2Service) AddGrantType(rd *GrantType) *GrantTypeResponse
AddGrantType AddGrantType
func (*MockOauth2Service) AddRedirectURI ¶
func (s *MockOauth2Service) AddRedirectURI(rd *RedirectURI) *RedirectURIResponse
AddRedirectURI AddRedirectURI
func (*MockOauth2Service) AddRoleURI ¶
func (s *MockOauth2Service) AddRoleURI(ru *RoleURI) *RoleURIResponse
AddRoleURI AddRoleURI
func (*MockOauth2Service) AddUser ¶
func (s *MockOauth2Service) AddUser(user *User) *UserResponse
AddUser AddUser
func (*MockOauth2Service) DeleteAllowedURI ¶
func (s *MockOauth2Service) DeleteAllowedURI(id string) *AllowedURIResponse
DeleteAllowedURI DeleteAllowedURI
func (*MockOauth2Service) DeleteClient ¶
func (s *MockOauth2Service) DeleteClient(id string) *ClientResponse
DeleteClient DeleteClient
func (*MockOauth2Service) DeleteClientRole ¶
func (s *MockOauth2Service) DeleteClientRole(id string) *ClientRoleResponse
DeleteClientRole DeleteClientRole
func (*MockOauth2Service) DeleteGrantType ¶
func (s *MockOauth2Service) DeleteGrantType(id string) *GrantTypeResponse
DeleteGrantType DeleteGrantType
func (*MockOauth2Service) DeleteRedirectURI ¶
func (s *MockOauth2Service) DeleteRedirectURI(id string) *RedirectURIResponse
DeleteRedirectURI DeleteRedirectURI
func (*MockOauth2Service) DeleteRoleURI ¶
func (s *MockOauth2Service) DeleteRoleURI(ru *RoleURI) *RoleURIResponse
DeleteRoleURI DeleteRoleURI
func (*MockOauth2Service) DeleteUser ¶
func (s *MockOauth2Service) DeleteUser(username string, clientID string) *UserResponse
DeleteUser DeleteUser
func (*MockOauth2Service) GetAllowedURI ¶
func (s *MockOauth2Service) GetAllowedURI(id string) (*AllowedURI, int)
GetAllowedURI GetAllowedURI
func (*MockOauth2Service) GetAllowedURIList ¶
func (s *MockOauth2Service) GetAllowedURIList(clientID string) (*[]AllowedURI, int)
GetAllowedURIList GetAllowedURIList
func (*MockOauth2Service) GetClient ¶
func (s *MockOauth2Service) GetClient(clientID string) (*Client, int)
GetClient GetClient
func (*MockOauth2Service) GetClientList ¶
func (s *MockOauth2Service) GetClientList() (*[]Client, int)
GetClientList GetClientList
func (*MockOauth2Service) GetClientRoleList ¶
func (s *MockOauth2Service) GetClientRoleList(clientID string) (*[]ClientRole, int)
GetClientRoleList GetClientRoleList
func (*MockOauth2Service) GetGrantTypeList ¶
func (s *MockOauth2Service) GetGrantTypeList(clientID string) (*[]GrantType, int)
GetGrantTypeList GetGrantTypeList
func (*MockOauth2Service) GetRedirectURIList ¶
func (s *MockOauth2Service) GetRedirectURIList(clientID string) (*[]RedirectURI, int)
GetRedirectURIList GetRedirectURIList
func (*MockOauth2Service) GetRoleList ¶
func (s *MockOauth2Service) GetRoleList() (*[]Role, int)
GetRoleList GetRoleList
func (*MockOauth2Service) GetRoleURIList ¶
func (s *MockOauth2Service) GetRoleURIList(uID string) (*[]RoleURI, int)
GetRoleURIList GetRoleURIList
func (*MockOauth2Service) GetUser ¶
func (s *MockOauth2Service) GetUser(username string, clientID string) (*User, int)
GetUser GetUser
func (*MockOauth2Service) GetUserList ¶
func (s *MockOauth2Service) GetUserList() (*[]User, int)
GetUserList GetUserList
func (*MockOauth2Service) SearchClient ¶
func (s *MockOauth2Service) SearchClient(client *Client) (*[]Client, int)
SearchClient SearchClient
func (*MockOauth2Service) SearchUserList ¶
func (s *MockOauth2Service) SearchUserList(clientID string) (*[]User, int)
SearchUserList SearchUserList
func (*MockOauth2Service) SetToken ¶
func (s *MockOauth2Service) SetToken(token string)
SetToken SetToken
func (*MockOauth2Service) UpdateAllowedURI ¶
func (s *MockOauth2Service) UpdateAllowedURI(au *AllowedURI) *AllowedURIResponse
UpdateAllowedURI UpdateAllowedURI
func (*MockOauth2Service) UpdateClient ¶
func (s *MockOauth2Service) UpdateClient(client *Client) *ClientResponse
UpdateClient UpdateClient
func (*MockOauth2Service) UpdateUser ¶
func (s *MockOauth2Service) UpdateUser(user UpdateUser) *UserResponse
UpdateUser UpdateUser
type Oauth2Service ¶
type Oauth2Service struct {
Token string
ClientID string
//APIKey string
//UserID string
//Hashed string
Host string
UserHost string
Proxy px.Proxy
Log *lg.Logger
}
Oauth2Service Oauth2Service
func (*Oauth2Service) AddAllowedURI ¶
func (a *Oauth2Service) AddAllowedURI(au *AllowedURI) *AllowedURIResponse
AddAllowedURI add
func (*Oauth2Service) AddClient ¶
func (c *Oauth2Service) AddClient(client *Client) *ClientResponse
AddClient add template
func (*Oauth2Service) AddClientRole ¶
func (r *Oauth2Service) AddClientRole(cr *ClientRole) *ClientRoleResponse
AddClientRole AddClientRole
func (*Oauth2Service) AddGrantType ¶
func (g *Oauth2Service) AddGrantType(rd *GrantType) *GrantTypeResponse
AddGrantType AddGrantType
func (*Oauth2Service) AddRedirectURI ¶
func (r *Oauth2Service) AddRedirectURI(rd *RedirectURI) *RedirectURIResponse
AddRedirectURI AddRedirectURI
func (*Oauth2Service) AddRoleURI ¶
func (r *Oauth2Service) AddRoleURI(ru *RoleURI) *RoleURIResponse
AddRoleURI add
func (*Oauth2Service) AddUser ¶
func (u *Oauth2Service) AddUser(user *User) *UserResponse
AddUser add
func (*Oauth2Service) DeleteAllowedURI ¶
func (a *Oauth2Service) DeleteAllowedURI(id string) *AllowedURIResponse
DeleteAllowedURI delete DeleteAllowedURI
func (*Oauth2Service) DeleteClient ¶
func (c *Oauth2Service) DeleteClient(id string) *ClientResponse
DeleteClient delete DeleteClient
func (*Oauth2Service) DeleteClientRole ¶
func (r *Oauth2Service) DeleteClientRole(id string) *ClientRoleResponse
DeleteClientRole delete DeleteClientRole
func (*Oauth2Service) DeleteGrantType ¶
func (g *Oauth2Service) DeleteGrantType(id string) *GrantTypeResponse
DeleteGrantType delete DeleteGrantType
func (*Oauth2Service) DeleteRedirectURI ¶
func (r *Oauth2Service) DeleteRedirectURI(id string) *RedirectURIResponse
DeleteRedirectURI delete DeleteRedirectURI
func (*Oauth2Service) DeleteRoleURI ¶
func (r *Oauth2Service) DeleteRoleURI(ru *RoleURI) *RoleURIResponse
DeleteRoleURI add
func (*Oauth2Service) DeleteUser ¶
func (u *Oauth2Service) DeleteUser(username string, clientID string) *UserResponse
DeleteUser delete
func (*Oauth2Service) GetAllowedURI ¶
func (a *Oauth2Service) GetAllowedURI(id string) (*AllowedURI, int)
GetAllowedURI get GetAllowedURI
func (*Oauth2Service) GetAllowedURIList ¶
func (a *Oauth2Service) GetAllowedURIList(clientID string) (*[]AllowedURI, int)
GetAllowedURIList get GetAllowedURIList list
func (*Oauth2Service) GetClient ¶
func (c *Oauth2Service) GetClient(clientID string) (*Client, int)
GetClient get GetClient
func (*Oauth2Service) GetClientList ¶
func (c *Oauth2Service) GetClientList() (*[]Client, int)
GetClientList get client list
func (*Oauth2Service) GetClientRoleList ¶
func (r *Oauth2Service) GetClientRoleList(clientID string) (*[]ClientRole, int)
GetClientRoleList get GetClientRoleList list
func (*Oauth2Service) GetGrantTypeList ¶
func (g *Oauth2Service) GetGrantTypeList(clientID string) (*[]GrantType, int)
GetGrantTypeList get GetGrantTypeList list
func (*Oauth2Service) GetRedirectURIList ¶
func (r *Oauth2Service) GetRedirectURIList(clientID string) (*[]RedirectURI, int)
GetRedirectURIList get GetRedirectURIList list
func (*Oauth2Service) GetRoleList ¶
func (u *Oauth2Service) GetRoleList() (*[]Role, int)
GetRoleList get role list
func (*Oauth2Service) GetRoleURIList ¶
func (r *Oauth2Service) GetRoleURIList(uID string) (*[]RoleURI, int)
GetRoleURIList get GetRoleURIList list
func (*Oauth2Service) GetUser ¶
func (u *Oauth2Service) GetUser(username string, clientID string) (*User, int)
GetUser get
func (*Oauth2Service) GetUserList ¶
func (u *Oauth2Service) GetUserList() (*[]User, int)
GetUserList get user list
func (*Oauth2Service) SearchClient ¶
func (c *Oauth2Service) SearchClient(client *Client) (*[]Client, int)
SearchClient SearchClient
func (*Oauth2Service) SearchUserList ¶
func (u *Oauth2Service) SearchUserList(clientID string) (*[]User, int)
SearchUserList search by client
func (*Oauth2Service) UpdateAllowedURI ¶
func (a *Oauth2Service) UpdateAllowedURI(au *AllowedURI) *AllowedURIResponse
UpdateAllowedURI update UpdateAllowedURI
func (*Oauth2Service) UpdateClient ¶
func (c *Oauth2Service) UpdateClient(client *Client) *ClientResponse
UpdateClient update UpdateClient
func (*Oauth2Service) UpdateUser ¶
func (u *Oauth2Service) UpdateUser(user UpdateUser) *UserResponse
UpdateUser update
type RedirectURI ¶
type RedirectURI struct {
ID int64 `json:"id"`
ClientID int64 `json:"clientId"`
URI string `json:"uri"`
}
RedirectURI RedirectURI
type RedirectURIResponse ¶
type RedirectURIResponse struct {
Success bool `json:"success"`
ID int64 `json:"id"`
Code int `json:"code"`
}
RedirectURIResponse resp
type RoleURI ¶
type RoleURI struct {
ClientRoleID int64 `json:"clientRoleId"`
ClientAllowedURIID int64 `json:"clientAllowedUriId"`
}
RoleURI RoleURI
type RoleURIResponse ¶
RoleURIResponse resp
type Service ¶
type Service interface {
AddClient(client *Client) *ClientResponse
UpdateClient(client *Client) *ClientResponse
GetClient(clientID string) (*Client, int)
GetClientList() (*[]Client, int)
SearchClient(client *Client) (*[]Client, int)
DeleteClient(id string) *ClientResponse
AddAllowedURI(au *AllowedURI) *AllowedURIResponse
UpdateAllowedURI(au *AllowedURI) *AllowedURIResponse
GetAllowedURI(id string) (*AllowedURI, int)
GetAllowedURIList(clientID string) (*[]AllowedURI, int)
DeleteAllowedURI(id string) *AllowedURIResponse
AddClientRole(cr *ClientRole) *ClientRoleResponse
GetClientRoleList(clientID string) (*[]ClientRole, int)
DeleteClientRole(id string) *ClientRoleResponse
AddGrantType(rd *GrantType) *GrantTypeResponse
GetGrantTypeList(clientID string) (*[]GrantType, int)
DeleteGrantType(id string) *GrantTypeResponse
AddRedirectURI(rd *RedirectURI) *RedirectURIResponse
GetRedirectURIList(clientID string) (*[]RedirectURI, int)
DeleteRedirectURI(id string) *RedirectURIResponse
AddRoleURI(ru *RoleURI) *RoleURIResponse
GetRoleURIList(uID string) (*[]RoleURI, int)
DeleteRoleURI(ru *RoleURI) *RoleURIResponse
AddUser(user *User) *UserResponse
UpdateUser(user UpdateUser) *UserResponse
GetUser(username string, clientID string) (*User, int)
GetUserList() (*[]User, int)
SearchUserList(clientID string) (*[]User, int)
DeleteUser(username string, clientID string) *UserResponse
GetRoleList() (*[]Role, int)
SetToken(token string)
}
Service Service
type User ¶
type User struct {
Username string `json:"username"`
Password string `json:"password"`
Enabled bool `json:"enabled"`
EmailAddress string `json:"emailAddress"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
RoleID int64 `json:"roleId"`
ClientID int64 `json:"clientId"`
}
User user
type UserDis ¶
type UserDis struct {
Username string `json:"username"`
Enabled bool `json:"enabled"`
ClientID int64 `json:"clientId"`
}
UserDis user
type UserInfo ¶
type UserInfo struct {
Username string `json:"username"`
EmailAddress string `json:"emailAddress"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
RoleID int64 `json:"roleId"`
ClientID int64 `json:"clientId"`
}
UserInfo user
type UserPW ¶
type UserPW struct {
Username string `json:"username"`
Password string `json:"password"`
ClientID int64 `json:"clientId"`
}
UserPW user
type UserResponse ¶
type UserResponse struct {
Success bool `json:"success"`
Message string `json:"message"`
Code int `json:"code"`
}
UserResponse resp