http

package
v0.0.0-...-23da319 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthHeader  = "Authorization"
	AuthType    = "Bearer"
	AuthPublic  = "AuthPublic"
	AuthSession = "Session"
)

Variables

This section is empty.

Functions

func NewHTTPServer

func NewHTTPServer(
	ctx context.Context,
	cfg *config.Container,
	userService user.UserServicePort,
	tokenService auth.TokenMaker,
	sessionService auth.SessionServicePort,
) http.ServerMaker

Types

type ErrorResponse

type ErrorResponse struct {
	Message          string               `json:"message"`
	ValidationErrors []*ValidationMessage `json:"validation_errors,omitempty"`
	Error            string               `json:"error,omitempty"`
	Status           int                  `json:"status"`
}

type RedirectionResponse

type RedirectionResponse struct {
	Url string `json:"url"`
}

type SuccessResponse

type SuccessResponse[T any] struct {
	Data    T      `json:"data"`
	Message string `json:"message"`
	Status  int    `json:"status"`
}

type SuccessResponseWithoutData

type SuccessResponseWithoutData struct {
	Message string `json:"message"`
	Status  int    `json:"status"`
}

type ValidationMessage

type ValidationMessage struct {
	FailedField string `json:"failed_field"`
	Tag         string `json:"tag"`
	Message     string `json:"message"`
}

Jump to

Keyboard shortcuts

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