user

package
v0.22.2 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WireSet = wire.NewSet(
	NewFilePrefs,
	wire.Bind(new(PrefsInterface), new(*filePrefs)),
)

Functions

func NewFilePrefs

func NewFilePrefs(dir *dirs.TiltDevDir) *filePrefs

func UpdateMetricsMode

func UpdateMetricsMode(pi PrefsInterface, mode model.MetricsMode) error

Types

type FakePrefs

type FakePrefs struct {
	Prefs Prefs
}

func NewFakePrefs

func NewFakePrefs() *FakePrefs

func (*FakePrefs) Get

func (i *FakePrefs) Get() (Prefs, error)

func (*FakePrefs) Update

func (i *FakePrefs) Update(newPrefs Prefs) error

type Prefs

type Prefs struct {
	// The kind of metrics stack the user is talking to.
	MetricsMode model.MetricsMode `json:"metricsMode,omitempty" yaml:"metricsMode,omitempty"`
}

TODO(nick): Eventually would like this interface to help with 1) other kinds of user preferences (token? analytics opt-in/opt-out?) 2) server-based preferences

type PrefsInterface

type PrefsInterface interface {
	Get() (Prefs, error)
	Update(newPrefs Prefs) error
}

Read/write metrics setting from a store. Inspired loosely by https://pkg.go.dev/k8s.io/client-go/kubernetes/typed/core/v1#PodInterface

Jump to

Keyboard shortcuts

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