transport

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ACCOUNT_EXISTS = "account_already_exists"

Constrains

View Source
const ERROR_UNAUTHORIZED = "unauthorized"
View Source
const INTERNAL_SERVER_ERROR = "internal_server_error"

System

View Source
const INVALID_ACCOUNT_ID = "invalid_account_id"

Admin

View Source
const INVALID_BODY = "invalid_request_body"
View Source
const INVALID_CREDENTIALS = "invalid_credentials"
View Source
const SESSION_EXISTS = "session_already_exists"
View Source
const SUCCESS_CHANGED_PASSWORD = "password_changed_successfully"
View Source
const SUCCESS_LOGIN = "login_successful"
View Source
const SUCCESS_LOGOUT = "logout_successful"
View Source
const SUCCESS_RESET_PASSWORD_LINK = "password_reset_link_generated_successfully"
View Source
const VALIDATION_FAILED = "failed_data_validation"

Error message Account input

Variables

This section is empty.

Functions

func GetCookieModes added in v0.1.2

func GetCookieModes() (bool, http.SameSite)

func GetSessionOrTokenFromCookie

func GetSessionOrTokenFromCookie(ctx *gsk.Context) (*http.Cookie, *http.Cookie, error)

func HandleChangePasswordError added in v0.1.2

func HandleChangePasswordError(err error, ctx *gsk.Context)

func HandleCreateGroupError added in v0.1.2

func HandleCreateGroupError(err error, ctx *gsk.Context)

func HandleGetAccountError added in v0.1.2

func HandleGetAccountError(err error, ctx *gsk.Context)

func HandleJsonDecodeError

func HandleJsonDecodeError(err error, ctx *gsk.Context)

func HandleLoginError

func HandleLoginError(err error, ctx *gsk.Context)

func HandleLogoutError

func HandleLogoutError(err error, ctx *gsk.Context)

func HandleRegistrationError

func HandleRegistrationError(err error, ctx *gsk.Context)

func HandleValidationError

func HandleValidationError(errorMessages map[string]string, ctx *gsk.Context)

func ParseLimitAndOffset added in v0.1.2

func ParseLimitAndOffset(limit string, offset string) (limitInt int, offsetInt int, err error)

func ParseRemoteAddress added in v0.1.2

func ParseRemoteAddress(remoteAddr string) (ip, port string)

Types

type AccountListResponse added in v0.1.2

type AccountListResponse struct {
	Total int64             `json:"total"`
	Data  []AccountResponse `json:"data"`
}

type AccountResponse added in v0.1.2

type AccountResponse struct {
	ID        string    `json:"id"`
	Username  string    `json:"username"`
	Email     string    `json:"email"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	Groups    []string  `json:"groups,omitempty"`
}

type CredentialUpdateRequest added in v0.1.2

type CredentialUpdateRequest struct {
	Credentials    *ds.Account `json:"credentials"`
	NewCredentials *ds.Account `json:"updated_credentials"`
}

type GroupResponse added in v0.1.2

type GroupResponse = ds.Group

Jump to

Keyboard shortcuts

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