domain

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuditStatusSuccess string = "success"
	AuditStatusFail    string = "fail"
)
View Source
const (
	AuthEventLogin   string = "login"
	AuthEventLogoff  string = "logoff"
	AuthEventRefresh string = "refresh"
	AuthEventRevoke  string = "revoke"
)
View Source
const (
	DataEventCreate string = "create"
	DataEventChange string = "change"
	DataEventRemove string = "remove"
)
View Source
const (
	RoleWriter string = "audit-writer"
	RoleReader string = "audit-reader"
	RoleAdmin  string = "audit-admin"
)

application roles

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthAudit

type AuthAudit struct {
	ID           string
	Source       string
	EventDate    time.Time
	Event        string
	Status       string
	RequestID    string
	TraceID      string
	Username     string
	AccessToken  string
	RefreshToken string
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

func NewEmptyAuthAudit

func NewEmptyAuthAudit() *AuthAudit

func (*AuthAudit) BeforeChange

func (aa *AuthAudit) BeforeChange() error

func (*AuthAudit) BeforeCreate

func (aa *AuthAudit) BeforeCreate() error

func (*AuthAudit) GetEvent

func (aa *AuthAudit) GetEvent() string

func (*AuthAudit) GetEventDate

func (aa *AuthAudit) GetEventDate() time.Time

func (*AuthAudit) GetID

func (aa *AuthAudit) GetID() string

func (*AuthAudit) GetRequestID

func (aa *AuthAudit) GetRequestID() string

func (*AuthAudit) GetSource

func (aa *AuthAudit) GetSource() string

func (*AuthAudit) GetStatus

func (aa *AuthAudit) GetStatus() string

func (*AuthAudit) GetTraceID added in v0.0.2

func (aa *AuthAudit) GetTraceID() string

func (*AuthAudit) GetUsername

func (aa *AuthAudit) GetUsername() string

func (*AuthAudit) IsExists

func (aa *AuthAudit) IsExists() bool

func (*AuthAudit) SetID

func (aa *AuthAudit) SetID(id string)

func (*AuthAudit) ValidateChange

func (aa *AuthAudit) ValidateChange() error

func (*AuthAudit) ValidateCreate

func (aa *AuthAudit) ValidateCreate() error

type AuthAuditRepository

type AuthAuditRepository interface {
	domain.CRUDRepository[*AuthAudit, string]
	ListByPeriod(ctx context.Context, from, till time.Time, limit, offset int) ([]*AuthAudit, error)
	ListByUsername(ctx context.Context, username string, offset, limit int) ([]*AuthAudit, error)
}

type DataAudit

type DataAudit struct {
	ID              string
	Source          string
	EventDate       time.Time
	Event           string
	Status          string
	RequestID       string
	TraceID         string
	Username        string
	TypeName        string
	TypeDescription string
	InstanceID      string
	InstanceName    string
	Values          []*DataAuditValue
	CreatedAt       time.Time
	UpdatedAt       time.Time
}

func NewEmptyDataAudit

func NewEmptyDataAudit() *DataAudit

func (*DataAudit) BeforeChange

func (da *DataAudit) BeforeChange() error

func (*DataAudit) BeforeCreate

func (da *DataAudit) BeforeCreate() error

func (*DataAudit) GetEvent

func (da *DataAudit) GetEvent() string

func (*DataAudit) GetEventDate

func (da *DataAudit) GetEventDate() time.Time

func (*DataAudit) GetID

func (da *DataAudit) GetID() string

func (*DataAudit) GetRequestID

func (da *DataAudit) GetRequestID() string

func (*DataAudit) GetSource

func (da *DataAudit) GetSource() string

func (*DataAudit) GetStatus

func (da *DataAudit) GetStatus() string

func (*DataAudit) GetTraceID added in v0.0.2

func (da *DataAudit) GetTraceID() string

func (*DataAudit) GetUsername

func (da *DataAudit) GetUsername() string

func (*DataAudit) IsExists

func (da *DataAudit) IsExists() bool

func (*DataAudit) SetID

func (da *DataAudit) SetID(id string)

func (*DataAudit) ValidateChange

func (da *DataAudit) ValidateChange() error

func (*DataAudit) ValidateCreate

func (da *DataAudit) ValidateCreate() error

type DataAuditRepository

type DataAuditRepository interface {
	domain.CRUDRepository[*DataAudit, string]
	ListByPeriod(ctx context.Context, from, till time.Time, limit, offset int) ([]*DataAudit, error)
	ListByInstance(ctx context.Context, typeName string, instanceID string, limit, offset int) ([]*DataAudit, error)
}

type DataAuditValue

type DataAuditValue struct {
	Name        string
	Description string
	Before      string
	After       string
}

func (*DataAuditValue) ValidateChange

func (dav *DataAuditValue) ValidateChange() error

func (*DataAuditValue) ValidateCreate

func (dav *DataAuditValue) ValidateCreate() error

type TailRepository

type TailRepository[ID comparable] interface {
	GetTail(ctx context.Context, tailDate time.Time) ([]ID, error)
	Delete(ctx context.Context, id ID) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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