internal/api/entities.go
internal/api · 108 lines · 7 declarations · source
Declarations
type entityListRequest
type entityListRequest struct {
After *pg.EntityCursor `json:"after,omitempty"`
Limit *int `json:"limit,omitempty"`
}
type entityGetRequest
type entityGetRequest struct {
ID string `json:"id"`
}
type entityPurgeRequest
type entityPurgeRequest struct {
ID string `json:"id"`
Reason string `json:"reason"`
Confirm bool `json:"confirm"`
}
entityPurgeRequest withdraws an entity the extractor should not have made.
Confirm is the whole safety of the operation and is therefore a field rather than a route: the same request without it returns exactly what the confirmed one would do, computed by doing it and rolling back. An operator reads that, then sends it again with confirm.
method Server.purgeEntity
func (s *Server) purgeEntity(w http.ResponseWriter, r *http.Request, grant credential.Grant)
method Server.listEntities
func (s *Server) listEntities(w http.ResponseWriter, r *http.Request, grant credential.Grant)
method Server.getEntity
func (s *Server) getEntity(w http.ResponseWriter, r *http.Request, grant credential.Grant)
method Server.entityReadError
func (s *Server) entityReadError(w http.ResponseWriter, r *http.Request, grant credential.Grant, operation string, err error)