Documentation ¶
Index ¶
- Constants
- type Auditor
- type GetScopeIDAndEntries
- type MethodAuditor
- type NopAuditor
- func (a *NopAuditor) Audit(auditors ...*MethodAuditor) transport.ServiceOption
- func (a *NopAuditor) Begin() Recorder
- func (a *NopAuditor) GetApp(idObject interface{}) (*apistructs.ApplicationDTO, error)
- func (a *NopAuditor) GetOrg(id interface{}) (*apistructs.OrgDTO, error)
- func (a *NopAuditor) GetProject(id interface{}) (*apistructs.ProjectDTO, error)
- func (a *NopAuditor) Record(ctx context.Context, scope ScopeType, scopeID interface{}, template string, ...)
- func (a *NopAuditor) RecordError(ctx context.Context, scope ScopeType, scopeID interface{}, template string, ...)
- type Option
- type Recorder
- type ScopeQueryer
- type ScopeType
- type ValueFetcher
- type ValueFetcherWithContext
Constants ¶
View Source
const ( UserIDKey = "userId" OrgIDKey = "orgId" OrgNameKey = "orgName" ProjectIDKey = "projectId" ProjectNameKey = "projectName" AppIDKey = "appId" AppNameKey = "appName" )
special keys
View Source
const AuditServiceName = "audit"
AuditServiceName .
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auditor ¶
type Auditor interface { Recorder Begin() Recorder ScopeQueryer Audit(auditors ...*MethodAuditor) transport.ServiceOption }
Auditor .
type GetScopeIDAndEntries ¶
type GetScopeIDAndEntries func(ctx context.Context, req, resp interface{}, err error) (interface{}, map[string]interface{}, error)
GetScopeIDAndEntries .
type MethodAuditor ¶
type MethodAuditor struct {
// contains filtered or unexported fields
}
MethodAuditor .
func Method ¶
func Method(method interface{}, scope ScopeType, template string, getter GetScopeIDAndEntries, options ...Option) *MethodAuditor
Method .
func MethodWithError ¶
func MethodWithError(method interface{}, scope ScopeType, template string, getter GetScopeIDAndEntries, options ...Option) *MethodAuditor
MethodWithError .
type NopAuditor ¶
type NopAuditor struct{}
NopAuditor .
func (*NopAuditor) Audit ¶
func (a *NopAuditor) Audit(auditors ...*MethodAuditor) transport.ServiceOption
Audit .
func (*NopAuditor) GetApp ¶
func (a *NopAuditor) GetApp(idObject interface{}) (*apistructs.ApplicationDTO, error)
GetApp .
func (*NopAuditor) GetOrg ¶
func (a *NopAuditor) GetOrg(id interface{}) (*apistructs.OrgDTO, error)
GetOrg .
func (*NopAuditor) GetProject ¶
func (a *NopAuditor) GetProject(id interface{}) (*apistructs.ProjectDTO, error)
GetProject .
func (*NopAuditor) Record ¶
func (a *NopAuditor) Record(ctx context.Context, scope ScopeType, scopeID interface{}, template string, options ...Option)
Record .
func (*NopAuditor) RecordError ¶
func (a *NopAuditor) RecordError(ctx context.Context, scope ScopeType, scopeID interface{}, template string, options ...Option)
RecordError .
type Recorder ¶
type Recorder interface { Record(ctx context.Context, scope ScopeType, scopeID interface{}, template string, options ...Option) RecordError(ctx context.Context, scope ScopeType, scopeID interface{}, template string, options ...Option) }
Recorder .
type ScopeQueryer ¶
type ScopeQueryer interface { GetOrg(id interface{}) (*apistructs.OrgDTO, error) GetProject(id interface{}) (*apistructs.ProjectDTO, error) GetApp(idObject interface{}) (*apistructs.ApplicationDTO, error) }
ScopeQueryer .
type ValueFetcherWithContext ¶
ValueFetcherWithContext .
Click to show internal directories.
Click to hide internal directories.