web

package
v0.0.0-...-40b4526 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetCtxValues

func SetCtxValues(ctx context.Context, values *Values) context.Context

SetCtxValues extends given context with new instance of context Values.

Types

type Response

type Response struct {
	Message string `json:"message,omitempty"`
	Error   string `json:"error,omitempty"`
}

Response encapsulates the details of generic web response used withing the app.

func Error

func Error(err error) Response

Error is a constructor for generic web error response used by various http endpoints.

func Success

func Success() Response

Success is a constructor for generic web success response used by various http endpoints.

type Values

type Values struct {
	TraceID   string
	StartedAt time.Time
}

Values encapsulates the details of the request which will be shared across program boundaries within the context.

func GetCtxValues

func GetCtxValues(ctx context.Context) (*Values, error)

GetCtxValues retrieves instance of context Values out of given context.

Jump to

Keyboard shortcuts

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