Documentation ¶
Index ¶
- Variables
- func HandleErrorHTTP(logger *log.Logger, err error, w http.ResponseWriter, r *http.Request)
- func ReplyError(w http.ResponseWriter, err error)
- func ReplyJSON(w http.ResponseWriter, v interface{})
- func SetupRoutes(mux *http.ServeMux, logger *log.Logger, registry prometheus.Registerer, ...)
- func StatusError(code int, msg string, cause error) *statusError
- func VersionHandler(w http.ResponseWriter, _ *http.Request)
- type Collector
- type Profile
- type ProfilesHandler
- func (h *ProfilesHandler) HandleCreateProfile(w http.ResponseWriter, r *http.Request) error
- func (h *ProfilesHandler) HandleFindProfiles(w http.ResponseWriter, r *http.Request) error
- func (h *ProfilesHandler) HandleGetProfile(w http.ResponseWriter, r *http.Request) error
- func (h *ProfilesHandler) HandleMergeProfiles(w http.ResponseWriter, r *http.Request) error
- func (h *ProfilesHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
- type Querier
- func (q *Querier) FindMergeProfileTo(ctx context.Context, dst io.Writer, params *storage.FindProfilesParams) error
- func (q *Querier) FindProfiles(ctx context.Context, params *storage.FindProfilesParams) ([]Profile, error)
- func (q *Querier) GetProfilesTo(ctx context.Context, dst io.Writer, pids []profile.ID) error
- func (q *Querier) ListServices(ctx context.Context) ([]string, error)
- type ServicesHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoResults = StatusError(http.StatusNoContent, "no results", nil) ErrNotFound = StatusError(http.StatusNotFound, "nothing found", nil) )
Functions ¶
func HandleErrorHTTP ¶
func ReplyError ¶
func ReplyError(w http.ResponseWriter, err error)
func ReplyJSON ¶
func ReplyJSON(w http.ResponseWriter, v interface{})
func SetupRoutes ¶
func SetupRoutes( mux *http.ServeMux, logger *log.Logger, registry prometheus.Registerer, collector *Collector, querier *Querier, )
func StatusError ¶
func VersionHandler ¶
func VersionHandler(w http.ResponseWriter, _ *http.Request)
Types ¶
type Profile ¶
type Profile struct { ProfileID profile.ID `json:"id"` ExternalID profile.ID `json:"external_id,omitempty"` Type string `json:"type"` Service string `json:"service"` Labels profile.Labels `json:"labels,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` }
Profile is the JSON representation of a profile returned with API response.
func ProfileFromProfileMeta ¶
type ProfilesHandler ¶
type ProfilesHandler struct {
// contains filtered or unexported fields
}
func NewProfilesHandler ¶
func NewProfilesHandler(logger *log.Logger, collector *Collector, querier *Querier) *ProfilesHandler
func (*ProfilesHandler) HandleCreateProfile ¶
func (h *ProfilesHandler) HandleCreateProfile(w http.ResponseWriter, r *http.Request) error
func (*ProfilesHandler) HandleFindProfiles ¶
func (h *ProfilesHandler) HandleFindProfiles(w http.ResponseWriter, r *http.Request) error
func (*ProfilesHandler) HandleGetProfile ¶
func (h *ProfilesHandler) HandleGetProfile(w http.ResponseWriter, r *http.Request) error
func (*ProfilesHandler) HandleMergeProfiles ¶
func (h *ProfilesHandler) HandleMergeProfiles(w http.ResponseWriter, r *http.Request) error
func (*ProfilesHandler) ServeHTTP ¶
func (h *ProfilesHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Querier ¶
type Querier struct {
// contains filtered or unexported fields
}
func (*Querier) FindMergeProfileTo ¶
func (*Querier) FindProfiles ¶
func (*Querier) GetProfilesTo ¶
type ServicesHandler ¶
type ServicesHandler struct {
// contains filtered or unexported fields
}
func NewServicesHandler ¶
func NewServicesHandler(logger *log.Logger, querier *Querier) *ServicesHandler
func (*ServicesHandler) ServeHTTP ¶
func (h *ServicesHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.