Skip to main content

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"`
}

source

type entityGetRequest​

type entityGetRequest struct {
ID string `json:"id"`
}

source

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.

source

method Server.purgeEntity​

func (s *Server) purgeEntity(w http.ResponseWriter, r *http.Request, grant credential.Grant)

source

method Server.listEntities​

func (s *Server) listEntities(w http.ResponseWriter, r *http.Request, grant credential.Grant)

source

method Server.getEntity​

func (s *Server) getEntity(w http.ResponseWriter, r *http.Request, grant credential.Grant)

source

method Server.entityReadError​

func (s *Server) entityReadError(w http.ResponseWriter, r *http.Request, grant credential.Grant, operation string, err error)

source