Documentation ¶
Overview ¶
Package analytics defines all the functions and structs used to store traffic analytics.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnalyticsFilters ¶
type AnalyticsFilters struct { Usernames []string `json:"usernames"` SkippedUsernames []string `json:"skip_usernames"` }
AnalyticsFilters defines the analytics options.
func (AnalyticsFilters) HasFilter ¶
func (filters AnalyticsFilters) HasFilter() bool
HasFilter determine whether a record has a filter.
func (AnalyticsFilters) ShouldFilter ¶
func (filters AnalyticsFilters) ShouldFilter(record AnalyticsRecord) bool
ShouldFilter determine whether a record should to be filtered out.
type AnalyticsOptions ¶
type AnalyticsOptions struct { PoolSize int `json:"pool-size" mapstructure:"pool-size"` RecordsBufferSize uint64 `json:"records-buffer-size" mapstructure:"records-buffer-size"` StorageExpirationTime int `json:"storage-expiration-time" mapstructure:"storage-expiration-time"` Enable bool `json:"enable" mapstructure:"enable"` EnableDetailedRecording bool `json:"enable-detailed-recording" mapstructure:"enable-detailed-recording"` }
AnalyticsOptions contains configuration items related to analytics.
func NewAnalyticsOptions ¶
func NewAnalyticsOptions() *AnalyticsOptions
NewAnalyticsOptions creates a AnalyticsOptions object with default parameters.
func (*AnalyticsOptions) AddFlags ¶
func (o *AnalyticsOptions) AddFlags(fs *pflag.FlagSet)
AddFlags adds flags related to features for a specific api server to the specified FlagSet.
func (*AnalyticsOptions) Validate ¶
func (o *AnalyticsOptions) Validate() []error
Validate is used to parse and validate the parameters entered by the user at the command line when the program starts.
type AnalyticsRecord ¶
type AnalyticsRecord struct { TimeStamp int64 `json:"timestamp"` Username string `json:"username"` Effect string `json:"effect"` Conclusion string `json:"conclusion"` Request string `json:"request"` Policies string `json:"policies"` Deciders string `json:"deciders"` ExpireAt time.Time `json:"expireAt" bson:"expireAt"` }
AnalyticsRecord encodes the details of a authorization request.
func (*AnalyticsRecord) GetFieldNames ¶
func (a *AnalyticsRecord) GetFieldNames() []string
GetFieldNames returns all the AnalyticsRecord field names.
func (*AnalyticsRecord) GetLineValues ¶
func (a *AnalyticsRecord) GetLineValues() []string
GetLineValues returns all the line values.