web

package
v0.0.0-...-e6e2e8d Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package web defines common components for a web application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetErrorMsg

func GetErrorMsg(ve validator.ValidationErrors) string

GetErrorMsg parses error message from request validator.

Types

type Response

type Response struct {
	AccessToken           string     `json:"access_token,omitempty"`
	AccessTokenExpiresAt  *time.Time `json:"access_token_expires_at,omitempty"`
	RefreshToken          string     `json:"refresh_token,omitempty"`
	RefreshTokenExpiresAt *time.Time `json:"refresh_token_expires_at,omitempty"`
	Data                  any        `json:"data,omitempty"`
	Error                 string     `json:"error,omitempty"`
}

Response holds the common response type for all APIs.

func Error

func Error(err error) Response

Error wraps a given err into json frinedly struct.

Jump to

Keyboard shortcuts

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