Documentation ¶
Index ¶
- type CreateUserInput
- type EventStore
- func (s *EventStore) Create(ctx context.Context, events []models.Event) error
- func (s EventStore) GetByID(ctx context.Context, id string) (models.Event, error)
- func (s *EventStore) ListUniqueEventNames(ctx context.Context) ([]models.EventNameAutoFillValue, error)
- func (s *EventStore) ListUniqueEventUsernames(ctx context.Context) ([]models.UsernameAutoFillValue, error)
- func (s *EventStore) Query(ctx context.Context, input EventStoreQueryBuilder) ([]models.Event, error)
- type EventStoreQueryBuilder
- type NewEventStoreInput
- type NewUserStoreInput
- type UserStore
- func (s *UserStore) All(ctx context.Context) ([]models.User, error)
- func (s *UserStore) Create(ctx context.Context, input CreateUserInput) (*models.User, error)
- func (s *UserStore) GetByUsername(ctx context.Context, username string) (models.User, error)
- func (s *UserStore) Update(ctx context.Context, u models.User) (models.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateUserInput ¶
type EventStore ¶
type EventStore struct {
// contains filtered or unexported fields
}
func MustNewEventStore ¶
func MustNewEventStore(config NewEventStoreInput) *EventStore
MustNewEventStore expects a configured and live ent database client this function will panic if passed a nil database connection
func (*EventStore) Create ¶
Create will insert new events into the database, if the database is not available the events will be saved to disk and a retry will be attempted later. An error is only returned if the insert failed as well as writing the file to disk. This could happen because the disk is full or other IO errors
func (*EventStore) ListUniqueEventNames ¶
func (s *EventStore) ListUniqueEventNames(ctx context.Context) ([]models.EventNameAutoFillValue, error)
func (*EventStore) ListUniqueEventUsernames ¶
func (s *EventStore) ListUniqueEventUsernames(ctx context.Context) ([]models.UsernameAutoFillValue, error)
listUniqueEventUsernames gets all the unique usernames from the database, this can probably grow out of control someday and we should deal with that
func (*EventStore) Query ¶
func (s *EventStore) Query(ctx context.Context, input EventStoreQueryBuilder) ([]models.Event, error)
type EventStoreQueryBuilder ¶
type EventStoreQueryBuilder struct { Username *string Resource *string StartTime time.Time EndTime time.Time EventName *string RequestID *string EventSource *string EventIP *string ReadOnly *bool Limit int Page int }
EventStoreQueryBuilder is used to construct an event query, the only required fields are EndTime, StartTime, Limit and Page
type NewEventStoreInput ¶
type NewUserStoreInput ¶
type UserStore ¶
type UserStore struct {
// contains filtered or unexported fields
}
func MustNewUserStore ¶
func MustNewUserStore(config NewUserStoreInput) *UserStore