Documentation ¶
Index ¶
- type LoginInput
- type LoginOutput
- type ServiceAuth
- func (s *ServiceAuth) Exchange(provider, code string) (*oauth2.Token, error)
- func (s *ServiceAuth) GenerateStateAndGetAuthURL(provider string) (string, string, error)
- func (s *ServiceAuth) GetIDFromProvider(provider string, token *oauth2.Token) (string, error)
- func (s *ServiceAuth) Login(li LoginInput) (*LoginOutput, int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LoginInput ¶
type LoginInput struct { CompanyUsername string `max:"16" json:"company_username"` EmployeeIdentifier string `max:"48" json:"employee_identifier"` Password string `min:"8" json:"password"` }
LoginInput is used as request for login
type LoginOutput ¶
type LoginOutput struct {
Token string `json:"token"`
}
LoginOutput is used as response for login
type ServiceAuth ¶
type ServiceAuth struct {
// contains filtered or unexported fields
}
ServiceAuth contains repositories and Auth use cases
func New ¶
func New( rAuth repository.RepositoryAuth, rCompany repository.RepositoryCompany, rEmployee repository.RepositoryEmployee, rRole repository.RepositoryRole, ) *ServiceAuth
New returns the ServiceAuth service
func (*ServiceAuth) Exchange ¶
func (s *ServiceAuth) Exchange(provider, code string) (*oauth2.Token, error)
Exchange is used to get token from provider using provider's code
func (*ServiceAuth) GenerateStateAndGetAuthURL ¶
func (s *ServiceAuth) GenerateStateAndGetAuthURL(provider string) (string, string, error)
GenerateStateAndGetAuthURL is used to generate state and get Auth URL
func (*ServiceAuth) GetIDFromProvider ¶
GetIDFromProvider is used to get ID from provider.
func (*ServiceAuth) Login ¶
func (s *ServiceAuth) Login(li LoginInput) (*LoginOutput, int, error)
Login is used to logged in a user
Click to show internal directories.
Click to hide internal directories.