Documentation ¶
Index ¶
- func GetCollections(ccache *CollectionsCache) func(params operations.GetCollectionsParams) middleware.Responder
- func GetCollectionsOfOu(ccache *CollectionsCache) func(params operations.GetCollectionsOuIDParams) middleware.Responder
- func GetCollectionsOfProject(ccache *CollectionsCache) func(params operations.GetCollectionsProjectIDParams) middleware.Responder
- func GetMetrics(ucache *UsersCache, ccache *CollectionsCache) func(p operations.GetMetricsParams) middleware.Responder
- func GetPing(cfg config.Configuration) ...
- func GetUsers(ucache *UsersCache) func(params operations.GetUsersParams) middleware.Responder
- func GetUsersOfOu(ucache *UsersCache) func(params operations.GetUsersOuIDParams) middleware.Responder
- func NewCustomResponder(r *http.Request, h http.Handler) middleware.Responder
- func SearchUsers(ucache *UsersCache) func(params operations.GetUsersSearchParams) middleware.Responder
- type CollectionsCache
- type CustomResponder
- type UsersCache
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCollections ¶
func GetCollections(ccache *CollectionsCache) func(params operations.GetCollectionsParams) middleware.Responder
GetCollections returns all collections.
func GetCollectionsOfOu ¶
func GetCollectionsOfOu(ccache *CollectionsCache) func(params operations.GetCollectionsOuIDParams) middleware.Responder
GetCollectionsOfOu returns all collections of an organisational unit.
func GetCollectionsOfProject ¶
func GetCollectionsOfProject(ccache *CollectionsCache) func(params operations.GetCollectionsProjectIDParams) middleware.Responder
GetCollectionsOfProject returns all collections of a project.
func GetMetrics ¶
func GetMetrics(ucache *UsersCache, ccache *CollectionsCache) func(p operations.GetMetricsParams) middleware.Responder
GetMetrics handles the metrics request with the Prometheus handler
func GetPing ¶
func GetPing(cfg config.Configuration) func(params operations.GetPingParams, principle *models.Principal) middleware.Responder
GetPing returns dummy string for health check, including the authentication.
func GetUsers ¶
func GetUsers(ucache *UsersCache) func(params operations.GetUsersParams) middleware.Responder
GetUsers returns all users.
func GetUsersOfOu ¶
func GetUsersOfOu(ucache *UsersCache) func(params operations.GetUsersOuIDParams) middleware.Responder
GetUsersOfOu returns all users of an organisational unit.
func NewCustomResponder ¶
func SearchUsers ¶
func SearchUsers(ucache *UsersCache) func(params operations.GetUsersSearchParams) middleware.Responder
SearchUsers returns all users with matched email and/or display name.
Types ¶
type CollectionsCache ¶
type CollectionsCache struct { // Config is the general API server configuration. Config config.Configuration // Context is the API server context. Context context.Context // contains filtered or unexported fields }
CollectionsCache is an in-memory store for caching all DR collections.
func (*CollectionsCache) GetCollections ¶
func (c *CollectionsCache) GetCollections() []*dr.DRCollection
GetCollections returns all collections from cache
func (*CollectionsCache) Init ¶
func (c *CollectionsCache) Init()
init initializes the cache with first reload.
func (*CollectionsCache) UpdateConfig ¶
func (c *CollectionsCache) UpdateConfig(cfg config.Configuration)
UpdateConfig updates configuration data
type CustomResponder ¶
type CustomResponder func(http.ResponseWriter, runtime.Producer)
This trick of integrating promhttp handler with swagger server is taken from the blog: https://www.kaznacheev.me/posts/en/go_swagger_tricks/
func (CustomResponder) WriteResponse ¶
func (c CustomResponder) WriteResponse(w http.ResponseWriter, p runtime.Producer)
type UsersCache ¶
type UsersCache struct { // Config is the general API server configuration. Config config.Configuration // Context is the API server context. Context context.Context // contains filtered or unexported fields }
UsersCache is an in-memory store for caching all DR users.
func (*UsersCache) GetUsers ¶
func (c *UsersCache) GetUsers() []*dr.DRUser
GetUsers returns all users from cache
func (*UsersCache) UpdateConfig ¶
func (c *UsersCache) UpdateConfig(cfg config.Configuration)
UpdateConfig updates configuration data