Commit Graph

14 Commits

Author SHA1 Message Date
Gibheer c7ead94934 convert query result to dim result
This modifies the zone list command in such a way, that a query result
could be directly returned to the response.

With a bit of work, large query results could be rendered with a
streaming json renderer to the output.
2021-05-03 19:39:41 +02:00
Gibheer feb4569547 provide initial versions of zone endpoints
These are only examples for now and nothing serious yet but showcase the
innards of query and types for now.

It is a beginning.
2021-04-28 21:09:38 +02:00
Gibheer b8f2414675 add a FieldList type
This type represents a list of fields someone might want to have
returned.
This can be used together with the query library to build select
statements that return the exact data the user might need or want.

This way we may be able to avoid selecting data one might not need at
the end and therefore provide better performance.
2021-04-28 21:08:24 +02:00
Gibheer 888655cc03 add String() method to zone
This way we can print it in nicer ways.
2021-04-28 21:06:38 +02:00
Gibheer ee5acc6ded add query interface
This is a small library to build queries and put the result into the
world.
Currently it supports building the select clause and converting rows
into a list of maps, so that it can be returned as a list.
2021-04-28 21:05:31 +02:00
Gibheer 1015861af8 add initial database schema
Usermanagement is still missing, but it is a first sketch on how things
could look like.
2021-04-24 21:42:19 +02:00
Gibheer 61d7ed2536 change zone type name to zonename
This should make it more obvious for what this type is intended.
2021-04-24 21:36:11 +02:00
Gibheer 3f04987290 add go.mod
We want it to be buildable by others, don't we?
2021-04-22 10:07:16 +02:00
Gibheer 9b3f2fddb1 add documentation for types package 2021-04-22 08:42:33 +02:00
Gibheer 7acd4803d0 add types package
This package will contain all the parameter types that need parsing from
the outside world into internal types.

Each type is required to implement its own UnmarshalJSON. At this point
it should also make the checks, if the incoming data is valid input, but
is not required to check against the database.
2021-04-22 08:35:24 +02:00
Gibheer 979164f4d2 add functions to parse incoming request parameters
These helpers enable the parameter parsing into method specific structs.
As the parameter list is an array, the order of arguments is important.

Sadly type checks can be done at runtime, because all parameters are
converted to a list of interface{}. So if there is an error, it will
only result in an error at runtime, so be careful.
2021-04-22 08:33:32 +02:00
Gibheer 35bf70b410 ignore generated binary 2021-04-21 21:58:14 +02:00
Gibheer bf0f3c5eac add transaction to context
This adds the transaction handling to the connection and context
handling.
It will raise an error and inform the client if anything is going wrong
with the transaction.
2021-04-21 21:50:46 +02:00
Gibheer 2ee6db04e5 initial release 2021-04-21 21:40:55 +02:00