Documentation
¶
Overview ¶
Package audit is the domain package for auditum.
Index ¶
- Variables
- func DecodePageToken(token string, cursor any) error
- func EncodePageToken(cursor Cursor) (string, error)
- type Actor
- type Cursor
- type ID
- type Operation
- type OperationStatus
- type Project
- type ProjectCursor
- type ProjectUpdate
- type Record
- type RecordCursor
- type RecordFilter
- type RecordUpdate
- type RecordsRestrictions
- type RecordsRestrictionsActor
- type RecordsRestrictionsOperation
- type RecordsRestrictionsResource
- type RecordsRestrictionsResourceChanges
- type RecordsSettings
- type Resource
- type ResourceChange
- type RestrictionsBytes
- type RestrictionsKeyValue
- type RestrictionsString
- type Settings
- type TraceContext
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrProjectNotFound = errors.New("project not found") ErrRecordNotFound = errors.New("record not found") ErrDisabled = errors.New("disabled") )
View Source
var DefaultSettings = Settings{ Records: RecordsSettings{ UpdateEnabled: false, DeleteEnabled: false, Restrictions: RecordsRestrictions{ Labels: RestrictionsKeyValue{ KeyMaxSizeBytes: 64, ValueMaxSizeBytes: 256, TotalMaxSizeBytes: 2048, }, Resource: RecordsRestrictionsResource{ Type: RestrictionsString{ MaxSizeBytes: 256, }, ID: RestrictionsString{ MaxSizeBytes: 256, }, Metadata: RestrictionsKeyValue{ KeyMaxSizeBytes: 64, ValueMaxSizeBytes: 256, TotalMaxSizeBytes: 2048, }, Changes: RecordsRestrictionsResourceChanges{ TotalMaxCount: 20, Name: RestrictionsString{ MaxSizeBytes: 256, }, Description: RestrictionsString{ MaxSizeBytes: 1024, }, OldValue: RestrictionsBytes{ MaxSizeBytes: 4096, }, NewValue: RestrictionsBytes{ MaxSizeBytes: 4096, }, }, }, Operation: RecordsRestrictionsOperation{ Type: RestrictionsString{ MaxSizeBytes: 256, }, ID: RestrictionsString{ MaxSizeBytes: 512, }, Metadata: RestrictionsKeyValue{ KeyMaxSizeBytes: 64, ValueMaxSizeBytes: 256, TotalMaxSizeBytes: 2048, }, }, Actor: RecordsRestrictionsActor{ Type: RestrictionsString{ MaxSizeBytes: 256, }, ID: RestrictionsString{ MaxSizeBytes: 256, }, Metadata: RestrictionsKeyValue{ KeyMaxSizeBytes: 64, ValueMaxSizeBytes: 256, TotalMaxSizeBytes: 2048, }, }, }, }, }
Functions ¶
func DecodePageToken ¶
func EncodePageToken ¶
Types ¶
type Operation ¶
type Operation struct {
Type string
ID string
Time time.Time
Metadata map[string]string
TraceContext TraceContext
Status OperationStatus
}
type OperationStatus ¶
type OperationStatus int
const ( OperationStatusUnspecified OperationStatus = iota OperationStatusSucceeded OperationStatusFailed )
func (OperationStatus) Int ¶
func (s OperationStatus) Int() int
type ProjectCursor ¶
type ProjectCursor struct {
LastID *ID `json:"lid,omitempty"`
}
func NewProjectCursor ¶
func NewProjectCursor(projects []Project, pageSize int32) ProjectCursor
func (ProjectCursor) Empty ¶
func (p ProjectCursor) Empty() bool
type ProjectUpdate ¶
type RecordCursor ¶
type RecordCursor struct {
LastOperationTime *time.Time `json:"lot,omitempty"`
LastID *ID `json:"lid,omitempty"`
}
func NewRecordCursor ¶
func NewRecordCursor(records []Record, pageSize int32) RecordCursor
func (RecordCursor) Empty ¶
func (p RecordCursor) Empty() bool
type RecordFilter ¶
type RecordUpdate ¶
type RecordsRestrictions ¶
type RecordsRestrictions struct {
Labels RestrictionsKeyValue `yaml:"labels" json:"labels"`
Resource RecordsRestrictionsResource `yaml:"resource" json:"resource"`
Operation RecordsRestrictionsOperation `yaml:"operation" json:"operation"`
Actor RecordsRestrictionsActor `yaml:"actor" json:"actor"`
}
func (RecordsRestrictions) Validate ¶
func (r RecordsRestrictions) Validate() error
type RecordsRestrictionsActor ¶
type RecordsRestrictionsActor struct {
Type RestrictionsString `yaml:"type" json:"type"`
ID RestrictionsString `yaml:"id" json:"id"`
Metadata RestrictionsKeyValue `yaml:"metadata" json:"metadata"`
}
func (RecordsRestrictionsActor) Validate ¶
func (r RecordsRestrictionsActor) Validate() error
type RecordsRestrictionsOperation ¶
type RecordsRestrictionsOperation struct {
Type RestrictionsString `yaml:"type" json:"type"`
ID RestrictionsString `yaml:"id" json:"id"`
Metadata RestrictionsKeyValue `yaml:"metadata" json:"metadata"`
}
func (RecordsRestrictionsOperation) Validate ¶
func (r RecordsRestrictionsOperation) Validate() error
type RecordsRestrictionsResource ¶
type RecordsRestrictionsResource struct {
Type RestrictionsString `yaml:"type" json:"type"`
ID RestrictionsString `yaml:"id" json:"id"`
Metadata RestrictionsKeyValue `yaml:"metadata" json:"metadata"`
Changes RecordsRestrictionsResourceChanges `yaml:"changes" json:"changes"`
}
func (RecordsRestrictionsResource) Validate ¶
func (r RecordsRestrictionsResource) Validate() error
type RecordsRestrictionsResourceChanges ¶
type RecordsRestrictionsResourceChanges struct {
TotalMaxCount int `yaml:"totalMaxCount" json:"totalMaxCount"`
Name RestrictionsString `yaml:"name" json:"name"`
Description RestrictionsString `yaml:"description" json:"description"`
OldValue RestrictionsBytes `yaml:"oldValue" json:"oldValue"`
NewValue RestrictionsBytes `yaml:"newValue" json:"newValue"`
}
func (RecordsRestrictionsResourceChanges) Validate ¶
func (r RecordsRestrictionsResourceChanges) Validate() error
type RecordsSettings ¶
type RecordsSettings struct {
UpdateEnabled bool `yaml:"updateEnabled" json:"updateEnabled"`
DeleteEnabled bool `yaml:"deleteEnabled" json:"deleteEnabled"`
Restrictions RecordsRestrictions `yaml:"restrictions" json:"restrictions"`
}
func (RecordsSettings) Validate ¶
func (r RecordsSettings) Validate() error
type Resource ¶
type Resource struct {
Type string
ID string
Metadata map[string]string
Changes []ResourceChange
}
type ResourceChange ¶
type ResourceChange struct {
Name string
Description string
OldValue json.RawMessage
NewValue json.RawMessage
}
type RestrictionsBytes ¶
type RestrictionsBytes struct {
MaxSizeBytes int `yaml:"maxSizeBytes" json:"maxSizeBytes"`
}
func (RestrictionsBytes) Validate ¶
func (r RestrictionsBytes) Validate() error
type RestrictionsKeyValue ¶
type RestrictionsKeyValue struct {
KeyMaxSizeBytes int `yaml:"keyMaxSizeBytes" json:"keyMaxSizeBytes"`
ValueMaxSizeBytes int `yaml:"valueMaxSizeBytes" json:"valueMaxSizeBytes"`
TotalMaxSizeBytes int `yaml:"totalMaxSizeBytes" json:"totalMaxSizeBytes"`
}
func (RestrictionsKeyValue) Validate ¶
func (r RestrictionsKeyValue) Validate() error
type RestrictionsString ¶
type RestrictionsString struct {
MaxSizeBytes int `yaml:"maxSizeBytes" json:"maxSizeBytes"`
}
func (RestrictionsString) Validate ¶
func (r RestrictionsString) Validate() error
type Settings ¶
type Settings struct {
Records RecordsSettings `yaml:"records" json:"records"`
}
type TraceContext ¶
func (TraceContext) IsZero ¶
func (tc TraceContext) IsZero() bool
Source Files
¶
Click to show internal directories.
Click to hide internal directories.