Documentation
¶
Index ¶
- Constants
- func Colorize(text, color string, enabled bool) string
- func ShouldColorize(mode ColorMode) bool
- type ColorMode
- type Formatter
- type JSONFormatter
- func (f *JSONFormatter) FormatAccount(w io.Writer, account *ga.Account) error
- func (f *JSONFormatter) FormatAccounts(w io.Writer, accounts []ga.Account) error
- func (f *JSONFormatter) FormatAudiences(w io.Writer, audiences []ga.Audience) error
- func (f *JSONFormatter) FormatAuthStatus(w io.Writer, authenticated bool, email string, expiry string, scopes []string) error
- func (f *JSONFormatter) FormatCustomDimensions(w io.Writer, dims []ga.CustomDimension) error
- func (f *JSONFormatter) FormatCustomMetrics(w io.Writer, metrics []ga.CustomMetric) error
- func (f *JSONFormatter) FormatDataStream(w io.Writer, stream *ga.DataStream) error
- func (f *JSONFormatter) FormatDataStreams(w io.Writer, streams []ga.DataStream) error
- func (f *JSONFormatter) FormatFunnel(w io.Writer, result *ga.FunnelResult) error
- func (f *JSONFormatter) FormatKeyValue(w io.Writer, data map[string]string) error
- func (f *JSONFormatter) FormatMetadata(w io.Writer, items []ga.MetadataItem) error
- func (f *JSONFormatter) FormatProperties(w io.Writer, properties []ga.Property) error
- func (f *JSONFormatter) FormatProperty(w io.Writer, property *ga.Property) error
- func (f *JSONFormatter) FormatReport(w io.Writer, result *ga.ReportResult) error
- type PlainFormatter
- func (f *PlainFormatter) FormatAccount(w io.Writer, account *ga.Account) error
- func (f *PlainFormatter) FormatAccounts(w io.Writer, accounts []ga.Account) error
- func (f *PlainFormatter) FormatAudiences(w io.Writer, audiences []ga.Audience) error
- func (f *PlainFormatter) FormatAuthStatus(w io.Writer, authenticated bool, email string, expiry string, scopes []string) error
- func (f *PlainFormatter) FormatCustomDimensions(w io.Writer, dims []ga.CustomDimension) error
- func (f *PlainFormatter) FormatCustomMetrics(w io.Writer, metrics []ga.CustomMetric) error
- func (f *PlainFormatter) FormatDataStream(w io.Writer, stream *ga.DataStream) error
- func (f *PlainFormatter) FormatDataStreams(w io.Writer, streams []ga.DataStream) error
- func (f *PlainFormatter) FormatFunnel(w io.Writer, result *ga.FunnelResult) error
- func (f *PlainFormatter) FormatKeyValue(w io.Writer, data map[string]string) error
- func (f *PlainFormatter) FormatMetadata(w io.Writer, items []ga.MetadataItem) error
- func (f *PlainFormatter) FormatProperties(w io.Writer, properties []ga.Property) error
- func (f *PlainFormatter) FormatProperty(w io.Writer, property *ga.Property) error
- func (f *PlainFormatter) FormatReport(w io.Writer, result *ga.ReportResult) error
- type TableFormatter
- func (f *TableFormatter) FormatAccount(w io.Writer, account *ga.Account) error
- func (f *TableFormatter) FormatAccounts(w io.Writer, accounts []ga.Account) error
- func (f *TableFormatter) FormatAudiences(w io.Writer, audiences []ga.Audience) error
- func (f *TableFormatter) FormatAuthStatus(w io.Writer, authenticated bool, email string, expiry string, scopes []string) error
- func (f *TableFormatter) FormatCustomDimensions(w io.Writer, dims []ga.CustomDimension) error
- func (f *TableFormatter) FormatCustomMetrics(w io.Writer, metrics []ga.CustomMetric) error
- func (f *TableFormatter) FormatDataStream(w io.Writer, stream *ga.DataStream) error
- func (f *TableFormatter) FormatDataStreams(w io.Writer, streams []ga.DataStream) error
- func (f *TableFormatter) FormatFunnel(w io.Writer, result *ga.FunnelResult) error
- func (f *TableFormatter) FormatKeyValue(w io.Writer, data map[string]string) error
- func (f *TableFormatter) FormatMetadata(w io.Writer, items []ga.MetadataItem) error
- func (f *TableFormatter) FormatProperties(w io.Writer, properties []ga.Property) error
- func (f *TableFormatter) FormatProperty(w io.Writer, property *ga.Property) error
- func (f *TableFormatter) FormatReport(w io.Writer, result *ga.ReportResult) error
Constants ¶
View Source
const ( Reset = "\033[0m" Bold = "\033[1m" Dim = "\033[2m" Red = "\033[31m" Green = "\033[32m" Yellow = "\033[33m" Blue = "\033[34m" Magenta = "\033[35m" Cyan = "\033[36m" White = "\033[37m" BoldCyan = "\033[1;36m" BoldGreen = "\033[1;32m" BoldRed = "\033[1;31m" )
ANSI color codes.
Variables ¶
This section is empty.
Functions ¶
func ShouldColorize ¶
ShouldColorize returns true if output should be colorized.
Types ¶
type ColorMode ¶
type ColorMode int
ColorMode determines when colors are used.
func ParseColorMode ¶
ParseColorMode converts a string to ColorMode.
type Formatter ¶
type Formatter interface {
FormatAccounts(w io.Writer, accounts []ga.Account) error
FormatAccount(w io.Writer, account *ga.Account) error
FormatProperties(w io.Writer, properties []ga.Property) error
FormatProperty(w io.Writer, property *ga.Property) error
FormatDataStreams(w io.Writer, streams []ga.DataStream) error
FormatDataStream(w io.Writer, stream *ga.DataStream) error
FormatReport(w io.Writer, result *ga.ReportResult) error
FormatFunnel(w io.Writer, result *ga.FunnelResult) error
FormatMetadata(w io.Writer, items []ga.MetadataItem) error
FormatAudiences(w io.Writer, audiences []ga.Audience) error
FormatCustomDimensions(w io.Writer, dims []ga.CustomDimension) error
FormatCustomMetrics(w io.Writer, metrics []ga.CustomMetric) error
FormatKeyValue(w io.Writer, data map[string]string) error
FormatAuthStatus(w io.Writer, authenticated bool, email string, expiry string, scopes []string) error
}
Formatter defines the output formatting interface.
func NewFormatter ¶
NewFormatter creates a formatter based on format type.
type JSONFormatter ¶
type JSONFormatter struct{}
JSONFormatter outputs data as pretty-printed JSON.
func (*JSONFormatter) FormatAccount ¶
func (*JSONFormatter) FormatAccounts ¶
func (*JSONFormatter) FormatAudiences ¶
func (*JSONFormatter) FormatAuthStatus ¶
func (*JSONFormatter) FormatCustomDimensions ¶
func (f *JSONFormatter) FormatCustomDimensions(w io.Writer, dims []ga.CustomDimension) error
func (*JSONFormatter) FormatCustomMetrics ¶
func (f *JSONFormatter) FormatCustomMetrics(w io.Writer, metrics []ga.CustomMetric) error
func (*JSONFormatter) FormatDataStream ¶
func (f *JSONFormatter) FormatDataStream(w io.Writer, stream *ga.DataStream) error
func (*JSONFormatter) FormatDataStreams ¶
func (f *JSONFormatter) FormatDataStreams(w io.Writer, streams []ga.DataStream) error
func (*JSONFormatter) FormatFunnel ¶
func (f *JSONFormatter) FormatFunnel(w io.Writer, result *ga.FunnelResult) error
func (*JSONFormatter) FormatKeyValue ¶
func (*JSONFormatter) FormatMetadata ¶
func (f *JSONFormatter) FormatMetadata(w io.Writer, items []ga.MetadataItem) error
func (*JSONFormatter) FormatProperties ¶
func (*JSONFormatter) FormatProperty ¶
func (*JSONFormatter) FormatReport ¶
func (f *JSONFormatter) FormatReport(w io.Writer, result *ga.ReportResult) error
type PlainFormatter ¶
type PlainFormatter struct{}
PlainFormatter outputs data as tab-separated values.
func (*PlainFormatter) FormatAccount ¶
func (*PlainFormatter) FormatAccounts ¶
func (*PlainFormatter) FormatAudiences ¶
func (*PlainFormatter) FormatAuthStatus ¶
func (*PlainFormatter) FormatCustomDimensions ¶
func (f *PlainFormatter) FormatCustomDimensions(w io.Writer, dims []ga.CustomDimension) error
func (*PlainFormatter) FormatCustomMetrics ¶
func (f *PlainFormatter) FormatCustomMetrics(w io.Writer, metrics []ga.CustomMetric) error
func (*PlainFormatter) FormatDataStream ¶
func (f *PlainFormatter) FormatDataStream(w io.Writer, stream *ga.DataStream) error
func (*PlainFormatter) FormatDataStreams ¶
func (f *PlainFormatter) FormatDataStreams(w io.Writer, streams []ga.DataStream) error
func (*PlainFormatter) FormatFunnel ¶
func (f *PlainFormatter) FormatFunnel(w io.Writer, result *ga.FunnelResult) error
func (*PlainFormatter) FormatKeyValue ¶
func (*PlainFormatter) FormatMetadata ¶
func (f *PlainFormatter) FormatMetadata(w io.Writer, items []ga.MetadataItem) error
func (*PlainFormatter) FormatProperties ¶
func (*PlainFormatter) FormatProperty ¶
func (*PlainFormatter) FormatReport ¶
func (f *PlainFormatter) FormatReport(w io.Writer, result *ga.ReportResult) error
type TableFormatter ¶
type TableFormatter struct {
// contains filtered or unexported fields
}
TableFormatter outputs data as formatted tables.
func (*TableFormatter) FormatAccount ¶
func (*TableFormatter) FormatAccounts ¶
func (*TableFormatter) FormatAudiences ¶
func (*TableFormatter) FormatAuthStatus ¶
func (*TableFormatter) FormatCustomDimensions ¶
func (f *TableFormatter) FormatCustomDimensions(w io.Writer, dims []ga.CustomDimension) error
func (*TableFormatter) FormatCustomMetrics ¶
func (f *TableFormatter) FormatCustomMetrics(w io.Writer, metrics []ga.CustomMetric) error
func (*TableFormatter) FormatDataStream ¶
func (f *TableFormatter) FormatDataStream(w io.Writer, stream *ga.DataStream) error
func (*TableFormatter) FormatDataStreams ¶
func (f *TableFormatter) FormatDataStreams(w io.Writer, streams []ga.DataStream) error
func (*TableFormatter) FormatFunnel ¶
func (f *TableFormatter) FormatFunnel(w io.Writer, result *ga.FunnelResult) error
func (*TableFormatter) FormatKeyValue ¶
func (*TableFormatter) FormatMetadata ¶
func (f *TableFormatter) FormatMetadata(w io.Writer, items []ga.MetadataItem) error
func (*TableFormatter) FormatProperties ¶
func (*TableFormatter) FormatProperty ¶
func (*TableFormatter) FormatReport ¶
func (f *TableFormatter) FormatReport(w io.Writer, result *ga.ReportResult) error
Click to show internal directories.
Click to hide internal directories.