routes

package
v0.0.0-...-df394e8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 11, 2022 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Version = "NA"
)

Version : API Version

Variables

This section is empty.

Functions

func APIInfo

func APIInfo(w http.ResponseWriter, r *http.Request)

APIInfo : handler function for GET / call

func Cron

func Cron(w http.ResponseWriter, r *http.Request)

Cron : handler function for GET /cron call

func DeleteDeviceGarbages

func DeleteDeviceGarbages(w http.ResponseWriter, r *http.Request)

DeleteDeviceGarbages : Delete Garbages of a Device

func Health

func Health(w http.ResponseWriter, r *http.Request)

Health : handler function for GET /health call

func MarkAllTrailGarbages

func MarkAllTrailGarbages(w http.ResponseWriter, r *http.Request)

MarkAllTrailGarbages : Mark trails as garbage that lost their parent device

func MarkDeviceAsGarbage

func MarkDeviceAsGarbage(w http.ResponseWriter, r *http.Request)

MarkDeviceAsGarbage : Mark a device as garbage

func MarkGarbagesInDeviceSummary

func MarkGarbagesInDeviceSummary(w http.ResponseWriter, r *http.Request)

MarkGarbagesInDeviceSummary : Mark Garbages (Devices which are deleted) In DeviceSummary (Db:pantabase_devicesummary,collection:device_summary_short_new_v2)

func MarkUnClaimedDevicesAsGarbage

func MarkUnClaimedDevicesAsGarbage(w http.ResponseWriter, r *http.Request)

MarkUnClaimedDevicesAsGarbage : Mark all unclaimed devices as garbage after a while(eg: after 5 days)

func PopulateStepsUsedObjects

func PopulateStepsUsedObjects(w http.ResponseWriter, r *http.Request)

PopulateStepsUsedObjects : Populate used_objects_field for all steps

func PopulateTrailsUsedObjects

func PopulateTrailsUsedObjects(w http.ResponseWriter, r *http.Request)

PopulateTrailsUsedObjects : Populate used_objects_field for all trails

func ProcessDeviceGarbages

func ProcessDeviceGarbages(w http.ResponseWriter, r *http.Request)

ProcessDeviceGarbages : Find all device documents with gc_processed=false then mark it associated trail as garbages

func ProcessStepGarbages

func ProcessStepGarbages(w http.ResponseWriter, r *http.Request)

ProcessStepGarbages : Find all step documents with gc_processed=false then mark it associated objects as garbages

func ProcessTrailGarbages

func ProcessTrailGarbages(w http.ResponseWriter, r *http.Request)

ProcessTrailGarbages : Find all trail documents with gc_processed=false then mark it associated steps as garbages

Types

type CronResponse

type CronResponse struct {
	Status                         int                                      `json:"status"`
	StatusMessage                  string                                   `json:"status_message"`
	Errors                         []error                                  `json:"errors"`
	DeleteDeviceGarbages           models.DeleteGarbagesResponse            `json:"delete_device_garbages"`
	MarkTrailGarbages              models.MarkTrailGarbagesResponse         `json:"mark_trail_garbages"`
	MarkUnclaimedDevicesAsGarbages models.MarkUnclaimedDevicesResponse      `json:"mark_unclaimed_devices_as_garbages"`
	PopulateStepsUsedObjects       models.PopulateStepsUsedObjectsResponse  `json:"populate_steps_used_objects"`
	PopulateTrailsUsedObjects      models.PopulateTrailsUsedObjectsResponse `json:"populate_trails_used_objects"`
	ProcessDeviceGarbages          models.ProcessDeviceGarbagesResponse     `json:"process_device_garbages"`
	ProcessTrailGarbages           models.ProcessTrailGarbagesResponse      `json:"process_trail_garbages"`
	ProcessStepGarbages            models.ProcessStepGarbagesResponse       `json:"process_step_garbages"`
}

CronResponse : Response of PUT /cron

type HealthResponse

type HealthResponse struct {
	Status        bool          `json:"status"`
	StatusMessage string        `json:"status_message"`
	ErrorCode     int           `json:"code"`
	Duration      time.Duration `json:"duration"`
	Start         time.Time     `json:"start-time"`
	Errors        []string      `json:"errors"`
}

HealthResponse : Health Response

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL