local

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2023 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MutationSignIn    = "signIn"
	SignInVarTemplate = `{{define "vars"}}"login":{{json .Login}},"password":{{json .Password}}{{end}}`
)
View Source
const (
	MutationSignUp    = "signUp"
	SignUpVarTemplate = `` /* 157-byte string literal not displayed */
)
View Source
const AuthorizationHeaderKey = "Authorization"
View Source
const MinimumTimeTokenStillValid = 5 * time.Minute
View Source
const TokenValidityDuration = 40 * time.Minute

Variables

This section is empty.

Functions

func SignIn

func SignIn(client web.HTTPClient, endpoint string, login string, password string) (*types.Token, error)

func SignUp

func SignUp(client web.HTTPClient, endpoint string, username string, email string, password string, orgName string, role string) (*types.Token, error)

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 SignInResponseDataDetails

type SignInResponseDataDetails struct {
	Token types.Token `json:"token,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"`
}

type SignUpResponseDataDetails

type SignUpResponseDataDetails struct {
	Token types.Token `json:"token,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL