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 Install

    func Install(ctx context.Context, c Client) context.Context

      Install puts the given `Client` implementation into the context.

      func InstallProd

      func InstallProd(ctx context.Context) (context.Context, error)

        InstallProd puts a production `Client` implementation.

        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.

          type State

          type State int8

            State enumerates possible values for tree state.

            Source of Truth: https://source.chromium.org/chromium/infra/infra/+/52a8cfcb436b0012e668630a2f261237046a033a:appengine/chromium_status/appengine_module/chromium_status/status.py;l=233-248

            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

              func FetchLatest

              func FetchLatest(ctx context.Context, endpoint string) (Status, error)

                FetchLatest fetches the latest tree status.

                This is a shortcut of `tree.mustClient(ctx).FetchLatest(ctx, endpoint)`.

                Source Files

                Directories

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