tree

package
v0.0.0-...-8ff35f7 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package tree implements fetching tree status from Tree Status App.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func URLToTreeName

func URLToTreeName(url string) string

URLToTreeName converts a tree status endpoint URL to a tree name. This follows the convention used to convert the URL in the old tree status apps.

Types

type Client

type Client interface {
	// FetchLatest fetches the latest tree status.
	FetchLatest(ctx context.Context, endpoint string) (Status, error)
}

Client defines the interface that interacts with Tree status App.

func NewClient

func NewClient(ctx context.Context, luciTreeStatusHost string) (Client, error)

type State

type State int8

State enumerates possible values for tree state.

const (
	StateUnknown State = iota
	Open
	Closed
	Throttled
	InMaintenance
)

type Status

type Status struct {
	// State describes the Tree state.
	State State
	// Since is the timestamp when the tree obtains the current state.
	Since time.Time
}

Status models the status returned by tree status app.

Note that only fields that are needed in CV are included. Source of Truth: https://source.chromium.org/chromium/infra/infra/+/52a8cfcb436b0012e668630a2f261237046a033a:appengine/chromium_status/appengine_module/chromium_status/status.py;l=209-252

Directories

Path Synopsis
Package treetest implements fake Tree for testing in CV.
Package treetest implements fake Tree for testing in CV.

Jump to

Keyboard shortcuts

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