Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
API provides a struct to wrap the api around
func Setup ¶
func Setup(ctx context.Context, isPublishing bool, r *mux.Router, dataStore DataStore, identityHandler func(http.Handler) http.Handler) *API
Setup function sets up the api and returns an API
func (*API) CreateOrUpdateCacheTime ¶
func (api *API) CreateOrUpdateCacheTime(ctx context.Context, w http.ResponseWriter, req *http.Request)
CreateOrUpdateCacheTime handles the creation or update of a cache time
func (*API) GetCacheTime ¶
GetCacheTime retrieves a cache time for a given ID and writes it to the HTTP response.
type DataStore ¶
type DataStore interface {
Checker(ctx context.Context, state *healthcheck.CheckState) error
Close(ctx context.Context) error
IsConnected(ctx context.Context) bool
GetCacheTime(ctx context.Context, id string) (*models.CacheTime, error)
UpsertCacheTime(ctx context.Context, cacheTime *models.CacheTime) error
}
DataStore defines the behaviour of a DataStore
Click to show internal directories.
Click to hide internal directories.