Documentation ¶
Index ¶
- Variables
- func ErrorResponse(w http.ResponseWriter, statusCode int, err error)
- func ErrorStatus(w http.ResponseWriter)
- type CookieOperation
- type TokenOperation
- func (t *TokenOperation) DeleteToken(w http.ResponseWriter, r *http.Request) error
- func (t *TokenOperation) GetRefreshToken(r *http.Request) (string, error)
- func (t *TokenOperation) GetSessionToken(r *http.Request) (string, error)
- func (t *TokenOperation) GetSessonTokenTrueRedirect(ctx context.Context, w http.ResponseWriter, r *http.Request, ...) (string, error)
- func (t *TokenOperation) SetRefreshToken(w http.ResponseWriter, refreshToken string)
- func (t *TokenOperation) SetSessionToken(w http.ResponseWriter, sessionToken string)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ErrorResponse ¶
func ErrorResponse(w http.ResponseWriter, statusCode int, err error)
func ErrorStatus ¶
func ErrorStatus(w http.ResponseWriter)
Types ¶
type CookieOperation ¶
func NewCookieOp ¶
func NewCookieOp(domain string) *CookieOperation
func (*CookieOperation) Delete ¶
func (c *CookieOperation) Delete(w http.ResponseWriter, req *http.Request, name string) error
Delete cookie
Arguments:
w {http.ResponseWriter} - http writer. req {http.Request} - http request.
name {string} - cookie key.
func (*CookieOperation) Get ¶
Get cookie.
Arguments:
req {http.Request} - http request. name {string} - cookie key.
Retruns:
{string} - cookie value.
func (*CookieOperation) Set ¶
func (c *CookieOperation) Set(w http.ResponseWriter, name string, value string, exp int)
Set cookie.
Arguments:
w {http.ResponseWriter} - http writer. name {string} - cookie key. value {string} - cookie value. exp {int} - date of expiry. It is an hourly unit.
type TokenOperation ¶
type TokenOperation struct {
CookieOp CookieOperation
}
func NewTokenOp ¶
func NewTokenOp(apiUrl string) (*TokenOperation, error)
Create tokenOp.
Arguments;
apiUrl {string} - URL of the API you are using.
func (*TokenOperation) DeleteToken ¶
func (t *TokenOperation) DeleteToken(w http.ResponseWriter, r *http.Request) error
Delete session and refresh tokens.
Arguments:
w {http.ResponseWriter} - http writer. r {*http.Request} - http requests.
func (*TokenOperation) GetRefreshToken ¶
func (t *TokenOperation) GetRefreshToken(r *http.Request) (string, error)
Get the refresh token.
Arguments:
r {*http.Request} - http requests.
Returns:
{string} - refresh token.
func (*TokenOperation) GetSessionToken ¶
func (t *TokenOperation) GetSessionToken(r *http.Request) (string, error)
Get the session token.
Arguments:
r {*http.Request} - http requests.
Returns:
{string} - session token.
func (*TokenOperation) GetSessonTokenTrueRedirect ¶
func (t *TokenOperation) GetSessonTokenTrueRedirect( ctx context.Context, w http.ResponseWriter, r *http.Request, tokenManageName string, apiUrl string, handlePath string) (string, error)
リフレッシュトークンを使用してログインします
func (*TokenOperation) SetRefreshToken ¶
func (t *TokenOperation) SetRefreshToken(w http.ResponseWriter, refreshToken string)
Set the refresh token.
Arguments:
w {http.ResponseWriter} - http writer. refreshToken {string} - refresh token.
func (*TokenOperation) SetSessionToken ¶
func (t *TokenOperation) SetSessionToken(w http.ResponseWriter, sessionToken string)
Set the session token.
Arguments:
w {http.ResponseWriter} - http writer. sessionToken {string} - session token.
Click to show internal directories.
Click to hide internal directories.