auditlog

package
v0.10.4 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitWithClient

func InitWithClient(c *logadmin.Client) func(*AuditLog)

func InitWithConfig

func InitWithConfig(cfg Config) func(*AuditLog)

Types

type AuditLog

type AuditLog struct {
	// contains filtered or unexported fields
}

func New

func New(logger log.Logger) *AuditLog

func (*AuditLog) Collect

func (l *AuditLog) Collect(ctx context.Context, tbl *bigquery.Table) (stats *TableStats, err error)

func (*AuditLog) Init

func (l *AuditLog) Init(ctx context.Context, opts ...InitOption) error

type Config

type Config struct {
	ProjectID           string
	ServiceAccountJSON  string
	IsCollectTableUsage bool
	UsagePeriodInDay    int64
	UsageProjectIDs     []string
}

type InitOption

type InitOption func(*AuditLog)

type JoinDetail

type JoinDetail struct {
	Usage      int64
	Conditions map[string]bool
}

type LogData

type LogData struct {
	*loggingpb.AuditData
}

func (*LogData) GetQuery

func (ld *LogData) GetQuery() (string, error)

func (*LogData) GetReferencedTablesURN

func (ld *LogData) GetReferencedTablesURN() []string

type TableStats

type TableStats struct {
	TableUsage       map[string]int64
	JoinDetail       map[string]map[string]JoinDetail
	FilterConditions map[string]map[string]bool
	// contains filtered or unexported fields
}

func NewTableStats

func NewTableStats() *TableStats

func (*TableStats) Populate

func (b *TableStats) Populate(ld *LogData) error

Jump to

Keyboard shortcuts

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