Documentation ¶
Index ¶
- Constants
- func HashMD5(s string) string
- func HashSHA1(s string) string
- func IsAnalyticsDisabledFromEnv() (bool, string)
- func WithAnalytics(ctx context.Context, a *TiltAnalytics) context.Context
- type AnalyticsOpter
- type FakeOpter
- type TiltAnalytics
- func (ta *TiltAnalytics) Count(name string, tags map[string]string, n int)
- func (ta *TiltAnalytics) EffectiveOpt() analytics.Opt
- func (ta *TiltAnalytics) Flush(timeout time.Duration)
- func (ta *TiltAnalytics) GitRepoHash() string
- func (ta *TiltAnalytics) GlobalTag(name string) (string, bool)
- func (ta *TiltAnalytics) Incr(name string, tags map[string]string)
- func (ta *TiltAnalytics) MachineHash() string
- func (ta *TiltAnalytics) SetTiltfileOpt(opt analytics.Opt)
- func (ta *TiltAnalytics) SetUserOpt(opt analytics.Opt) error
- func (ta *TiltAnalytics) TiltfileOpt() analytics.Opt
- func (ta *TiltAnalytics) Timer(name string, dur time.Duration, tags map[string]string)
- func (ta *TiltAnalytics) UserOpt() analytics.Opt
- func (ta *TiltAnalytics) WithoutGlobalTags() analytics.Analytics
Constants ¶
View Source
const TagGitRepoHash = "git.origin"
View Source
const TagOS = "os"
View Source
const TagSubcommand = "subcommand"
View Source
const TagVersion = "version"
Variables ¶
This section is empty.
Functions ¶
func IsAnalyticsDisabledFromEnv ¶ added in v0.10.16
If analytics is disabled, return a string representing a human-readable reason.
func WithAnalytics ¶ added in v0.8.7
func WithAnalytics(ctx context.Context, a *TiltAnalytics) context.Context
Types ¶
type AnalyticsOpter ¶
type AnalyticsOpter interface { SetUserOpt(opt analytics.Opt) error ReadUserOpt() (analytics.Opt, error) }
An AnalyticsOpter can record a user's choice (opt-in or opt-out) in re: Tilt recording analytics.
type FakeOpter ¶ added in v0.10.16
type FakeOpter struct {
// contains filtered or unexported fields
}
func DefaultFakeOpter ¶ added in v0.10.16
func DefaultFakeOpter() *FakeOpter
func NewFakeOpter ¶ added in v0.10.16
func (*FakeOpter) ReadUserOpt ¶ added in v0.10.16
func (*FakeOpter) SetUserOpt ¶ added in v0.10.16
type TiltAnalytics ¶
type TiltAnalytics struct {
// contains filtered or unexported fields
}
An Analytics that allows opting in/out at runtime.
func Get ¶ added in v0.8.7
func Get(ctx context.Context) *TiltAnalytics
func NewMemoryTiltAnalyticsForTest ¶ added in v0.8.8
func NewMemoryTiltAnalyticsForTest(opter AnalyticsOpter) (*analytics.MemoryAnalytics, *TiltAnalytics)
NOTE: if you need a ctx as well, use testutils.CtxAndAnalyticsForTest so that you get a ctx with the correct analytics baked in.
func NewTiltAnalytics ¶
func NewTiltAnalytics(opter AnalyticsOpter, a analytics.Analytics, tiltVersion string) (*TiltAnalytics, error)
func (*TiltAnalytics) Count ¶
func (ta *TiltAnalytics) Count(name string, tags map[string]string, n int)
func (*TiltAnalytics) EffectiveOpt ¶ added in v0.10.16
func (ta *TiltAnalytics) EffectiveOpt() analytics.Opt
func (*TiltAnalytics) Flush ¶
func (ta *TiltAnalytics) Flush(timeout time.Duration)
func (*TiltAnalytics) GitRepoHash ¶ added in v0.10.16
func (ta *TiltAnalytics) GitRepoHash() string
func (*TiltAnalytics) GlobalTag ¶ added in v0.10.16
func (ta *TiltAnalytics) GlobalTag(name string) (string, bool)
func (*TiltAnalytics) MachineHash ¶ added in v0.10.16
func (ta *TiltAnalytics) MachineHash() string
func (*TiltAnalytics) SetTiltfileOpt ¶ added in v0.10.16
func (ta *TiltAnalytics) SetTiltfileOpt(opt analytics.Opt)
func (*TiltAnalytics) SetUserOpt ¶ added in v0.10.16
func (ta *TiltAnalytics) SetUserOpt(opt analytics.Opt) error
func (*TiltAnalytics) TiltfileOpt ¶ added in v0.10.16
func (ta *TiltAnalytics) TiltfileOpt() analytics.Opt
func (*TiltAnalytics) UserOpt ¶ added in v0.10.16
func (ta *TiltAnalytics) UserOpt() analytics.Opt
func (*TiltAnalytics) WithoutGlobalTags ¶ added in v0.14.0
func (ta *TiltAnalytics) WithoutGlobalTags() analytics.Analytics
Click to show internal directories.
Click to hide internal directories.