Documentation
¶
Index ¶
Constants ¶
View Source
const ( QueryParamLimit = "limit" QueryParamOffset = "offset" QueryParamReleaseTime = "release_time" )
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(_ 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(w http.ResponseWriter, req *http.Request)
CreateOrUpdateCacheTime handles the creation or update of a cache time
func (*API) GetCacheTime ¶
func (api *API) GetCacheTime(w http.ResponseWriter, req *http.Request)
GetCacheTime retrieves a cache time for a given ID and writes it to the HTTP response.
func (*API) GetCacheTimes ¶ added in v1.7.0
func (api *API) GetCacheTimes(w http.ResponseWriter, req *http.Request)
GetCacheTimes retrieves a list of cache times with optional filtering and pagination.
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)
GetCacheTimes(ctx context.Context, offset int, limit int, releaseTime time.Time) ([]*models.CacheTime, int, 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.