recent

package
v0.0.0-...-4cf64ee Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RecentRouter

type RecentRouter struct {
	*httprouter.Router
	// contains filtered or unexported fields
}

RecentRouter is an HTTP API for accessing recent synchronisations.

func NewRouter

func NewRouter(r *RecentSynchronisations) *RecentRouter

NewRouter creates and returns a new RecentRouter.

func (*RecentRouter) GetLatest

func (a *RecentRouter) GetLatest(w http.ResponseWriter, r *http.Request)

GetLatest returns the most recent synchronisation log.

type RecentSynchronisations

type RecentSynchronisations struct {
	// contains filtered or unexported fields
}

RecentSynchronisations represents a ring buffer of recent sync states.

func NewRecentSynchronisations

func NewRecentSynchronisations(r *ring.Ring) *RecentSynchronisations

NewRecentSynchronisations creates and returns a ring buffer of synchronisations.

func (*RecentSynchronisations) Add

func (r *RecentSynchronisations) Add(start, end time.Time, sha plumbing.Hash, syncErr error, results []common.ResourceSyncResult)

Add records the details of a synchronisation in the ring.

func (*RecentSynchronisations) Latest

Latest returns the last recorded synchronisation.

type Synchronisation

type Synchronisation struct {
	Start   time.Time                   `json:"startTime"`
	End     time.Time                   `json:"endTime"`
	SHA     string                      `json:"sha"`
	Error   error                       `json:"err"`
	Results []common.ResourceSyncResult `json:"results"`
}

Synchronisation represents a sync run from the gitops engine.

Jump to

Keyboard shortcuts

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