Documentation ¶
Index ¶
- Constants
- func SignIn(client web.HTTPClient, endpoint string, login string, password string) (*types.Token, error)
- func SignUp(client web.HTTPClient, endpoint string, username string, email string, ...) (*types.Token, error)
- type AddSignInVariables
- type AddSignUpVariables
- type LocalRazeeClient
- type SignInResponse
- type SignInResponseData
- type SignInResponseDataDetails
- type SignUpResponse
- type SignUpResponseData
- type SignUpResponseDataDetails
Constants ¶
const ( MutationSignIn = "signIn" SignInVarTemplate = `{{define "vars"}}"login":{{json .Login}},"password":{{json .Password}}{{end}}` )
const ( MutationSignUp = "signUp" SignUpVarTemplate = `` /* 157-byte string literal not displayed */ )
const AuthorizationHeaderKey = "Authorization"
const MinimumTimeTokenStillValid = 5 * time.Minute
const TokenValidityDuration = 40 * time.Minute
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AddSignInVariables ¶
type AddSignInVariables struct { actions.GraphQLQuery Login string Password string }
AddSignInVariables are the variables specific to log in a user. These include the login and password. Rather than instantiating this directly, use NewSignInVariables().
func NewSignInVariables ¶
func NewSignInVariables(login string, password string) AddSignInVariables
NewSignInVariables creates a correctly formed instance of AddSignInVariables.
type AddSignUpVariables ¶
type AddSignUpVariables struct { actions.GraphQLQuery Username string Email string Password string OrgName string Role string }
AddSignUpVariables are the variables specific to adding a user. These include the username, email, password, organization name and role. Rather than instantiating this directly, use NewSignUpVariables().
func NewSignUpVariables ¶
func NewSignUpVariables(username string, email string, password string, orgName string, role string) AddSignUpVariables
NewSignUpVariables creates a correctly formed instance of AddSignUpVariables.
type LocalRazeeClient ¶
type LocalRazeeClient struct { HTTPClient web.HTTPClient // contains filtered or unexported fields }
func NewClient ¶
func NewClient(url string, login string, password string) (*LocalRazeeClient, error)
func NewClientWithHttpClient ¶
func NewClientWithHttpClient(httpClient web.HTTPClient, url string, login string, password string) (*LocalRazeeClient, error)
func (*LocalRazeeClient) Authenticate ¶
func (l *LocalRazeeClient) Authenticate(request *http.Request) error
type SignInResponse ¶
type SignInResponse struct {
Data *SignInResponseData `json:"data,omitempty"`
}
SignInResponse is the response body we get upon a successful user creation.
type SignInResponseData ¶
type SignInResponseData struct {
Details *SignInResponseDataDetails `json:"signIn,omitempty"`
}
type SignUpResponse ¶
type SignUpResponse struct {
Data *SignUpResponseData `json:"data,omitempty"`
}
SignUpResponse is the response body we get upon a successful user creation.
type SignUpResponseData ¶
type SignUpResponseData struct {
Details *SignUpResponseDataDetails `json:"signUp,omitempty"`
}