Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Log ¶
type Log struct { ID string `json:"id"` CreatedAt time.Time `json:"createdAt"` ActivityType string `json:"activityType"` UserID string `json:"userID,omitempty"` IPAddress string `json:"ipAddress,omitempty"` UserAgent string `json:"userAgent,omitempty"` ClientID string `json:"clientID,omitempty"` Data map[string]interface{} `json:"data,omitempty"` }
Log represents an audit log entry. The keys in JSON struct tags are in camel case because this struct is directly returned in the GraphQL endpoint. Making the keys in camel case saves us from writing boilerplate resolver code.
type Query ¶
type Query struct { Database *auditdb.ReadHandle Store *ReadStore }
func (*Query) QueryPage ¶
func (q *Query) QueryPage(ctx context.Context, opts QueryPageOptions, pageArgs graphqlutil.PageArgs) ([]model.PageItemRef, error)
type QueryPageOptions ¶
type QueryPageOptions struct { RangeFrom *time.Time RangeTo *time.Time ActivityTypes []string UserIDs []string EmailAddresses []string PhoneNumbers []string SortDirection model.SortDirection }
func (QueryPageOptions) Apply ¶
func (o QueryPageOptions) Apply(q db.SelectBuilder) db.SelectBuilder
type ReadStore ¶
type ReadStore struct { SQLBuilder *auditdb.SQLBuilderApp SQLExecutor *auditdb.ReadSQLExecutor }
type Sink ¶
type Sink struct { Logger Logger Database *auditdb.WriteHandle Store *WriteStore }
func (*Sink) ReceiveBlockingEvent ¶
type WriteStore ¶
type WriteStore struct { SQLBuilder *auditdb.SQLBuilderApp SQLExecutor *auditdb.WriteSQLExecutor }
func (*WriteStore) PersistLog ¶
func (s *WriteStore) PersistLog(ctx context.Context, logEntry *Log) (err error)
Click to show internal directories.
Click to hide internal directories.