chore: rewrite docstrings with generics
This commit is contained in:
parent
91a976c634
commit
b9598ca046
5 changed files with 8 additions and 8 deletions
|
|
@ -15,7 +15,7 @@ pub fn new_response(message string) Response[string] {
|
|||
}
|
||||
}
|
||||
|
||||
// new_data_response<T> constructs a new Response<T> object with the given data
|
||||
// new_data_response[T] constructs a new Response<T> object with the given data
|
||||
// & an empty message field.
|
||||
pub fn new_data_response[T](data T) Response[T] {
|
||||
return Response[T]{
|
||||
|
|
@ -24,7 +24,7 @@ pub fn new_data_response[T](data T) Response[T] {
|
|||
}
|
||||
}
|
||||
|
||||
// new_full_response<T> constructs a new Response<T> object with the given
|
||||
// new_full_response[T] constructs a new Response<T> object with the given
|
||||
// message & data.
|
||||
pub fn new_full_response[T](message string, data T) Response[T] {
|
||||
return Response[T]{
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ pub fn (mut ctx Context) body(status http.Status, content_type string, body stri
|
|||
return Result{}
|
||||
}
|
||||
|
||||
// json<T> HTTP_OK with json_s as payload with content-type `application/json`
|
||||
// json[T] HTTP_OK with json_s as payload with content-type `application/json`
|
||||
pub fn (mut ctx Context) json[T](status http.Status, j T) Result {
|
||||
ctx.status = status
|
||||
ctx.content_type = 'application/json'
|
||||
|
|
|
|||
Reference in a new issue