analytics

package
v0.0.0-...-395a5c9 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

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.

Jump to

Keyboard shortcuts

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