Documentation ¶
Index ¶
- type DetectorModel
- func (m *DetectorModel) Create(ctx context.Context, detector *echosight.Detector) error
- func (m *DetectorModel) DeleteByID(ctx context.Context, id uuid.UUID) (*echosight.Detector, error)
- func (m *DetectorModel) GetByID(ctx context.Context, id uuid.UUID) (*echosight.Detector, error)
- func (m *DetectorModel) GetByName(ctx context.Context, name string) (*echosight.Detector, error)
- func (m *DetectorModel) List(ctx context.Context, detectorFilter *filter.DetectorFilter) ([]*echosight.Detector, error)
- func (m *DetectorModel) Update(ctx context.Context, detector *echosight.Detector) error
- type HostModel
- func (m *HostModel) Create(ctx context.Context, host *echosight.Host) error
- func (m *HostModel) DeleteByID(ctx context.Context, id uuid.UUID) (*echosight.Host, error)
- func (m *HostModel) GetByID(ctx context.Context, id uuid.UUID) (*echosight.Host, error)
- func (m *HostModel) GetByName(ctx context.Context, name string) (*echosight.Host, error)
- func (m *HostModel) List(ctx context.Context, hostFilter *filter.HostFilter) ([]*echosight.Host, error)
- func (m *HostModel) Update(ctx context.Context, host *echosight.Host) error
- type PostgresDB
- type PreferenceModel
- func (p *PreferenceModel) AllPreferences(ctx context.Context) (*es.Preferences, error)
- func (p *PreferenceModel) DeleteByName(ctx context.Context, name string) error
- func (p *PreferenceModel) GetByName(ctx context.Context, name string) (*es.Preference, error)
- func (p *PreferenceModel) List(ctx context.Context, prefFilter *filter.PreferenceFilter) (*es.Preferences, error)
- func (p *PreferenceModel) Set(ctx context.Context, pref *es.Preference) error
- func (p *PreferenceModel) SetAll(ctx context.Context, prefs *es.Preferences) error
- func (p *PreferenceModel) Update(ctx context.Context, pref *es.Preference) error
- type RecipientModel
- func (m *RecipientModel) Create(ctx context.Context, recipient *es.Recipient) error
- func (m *RecipientModel) DeleteByID(ctx context.Context, id uuid.UUID) (*es.Recipient, error)
- func (m *RecipientModel) GetByEmail(ctx context.Context, email string) (*es.Recipient, error)
- func (m *RecipientModel) GetByID(ctx context.Context, id uuid.UUID) (*es.Recipient, error)
- func (m *RecipientModel) List(ctx context.Context, rcptFilter *filter.RecipientFilter) ([]*es.Recipient, error)
- func (m *RecipientModel) Update(ctx context.Context, rcpt *es.Recipient) error
- type SessionModel
- func (m *SessionModel) Delete(ctx context.Context, token string) error
- func (m *SessionModel) Get(ctx context.Context, token string) (*es.Session, bool, error)
- func (m *SessionModel) Put(ctx context.Context, session *es.Session) error
- func (m *SessionModel) StartCleanup(interval time.Duration)
- func (m *SessionModel) StopCleanup()
- type UserModel
- func (m *UserModel) Create(ctx context.Context, user *echosight.User) error
- func (m *UserModel) DeleteByID(ctx context.Context, id uuid.UUID) (*echosight.User, error)
- func (m *UserModel) GetByEmail(ctx context.Context, email string) (*echosight.User, error)
- func (m *UserModel) GetByID(ctx context.Context, id uuid.UUID) (*echosight.User, error)
- func (m *UserModel) List(ctx context.Context, userFilter *filter.UserFilter) ([]*echosight.User, error)
- func (m *UserModel) Update(ctx context.Context, user *echosight.User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DetectorModel ¶
type DetectorModel struct {
// contains filtered or unexported fields
}
func (*DetectorModel) DeleteByID ¶
func (*DetectorModel) List ¶
func (m *DetectorModel) List(ctx context.Context, detectorFilter *filter.DetectorFilter) ([]*echosight.Detector, error)
type HostModel ¶
type HostModel struct {
// contains filtered or unexported fields
}
func (*HostModel) DeleteByID ¶
type PostgresDB ¶
type PostgresDB struct { Users UserModel Hosts HostModel Detectors DetectorModel Recipients RecipientModel Preferences PreferenceModel Sessions SessionModel // contains filtered or unexported fields }
func New ¶
func New(dsn string) (*PostgresDB, error)
func (*PostgresDB) Bun ¶
func (db *PostgresDB) Bun() *bun.DB
func (*PostgresDB) Close ¶
func (db *PostgresDB) Close() error
type PreferenceModel ¶
type PreferenceModel struct {
// contains filtered or unexported fields
}
func (*PreferenceModel) AllPreferences ¶
func (p *PreferenceModel) AllPreferences(ctx context.Context) (*es.Preferences, error)
func (*PreferenceModel) DeleteByName ¶
func (p *PreferenceModel) DeleteByName(ctx context.Context, name string) error
func (*PreferenceModel) GetByName ¶
func (p *PreferenceModel) GetByName(ctx context.Context, name string) (*es.Preference, error)
func (*PreferenceModel) List ¶
func (p *PreferenceModel) List(ctx context.Context, prefFilter *filter.PreferenceFilter) (*es.Preferences, error)
func (*PreferenceModel) Set ¶
func (p *PreferenceModel) Set(ctx context.Context, pref *es.Preference) error
Set sets the preference by name. If a pref exists with the given name, it will be overwritten.
func (*PreferenceModel) SetAll ¶
func (p *PreferenceModel) SetAll(ctx context.Context, prefs *es.Preferences) error
func (*PreferenceModel) Update ¶
func (p *PreferenceModel) Update(ctx context.Context, pref *es.Preference) error
type RecipientModel ¶
type RecipientModel struct {
// contains filtered or unexported fields
}
func (*RecipientModel) DeleteByID ¶
func (*RecipientModel) GetByEmail ¶
func (*RecipientModel) List ¶
func (m *RecipientModel) List(ctx context.Context, rcptFilter *filter.RecipientFilter) ([]*es.Recipient, error)
type SessionModel ¶
type SessionModel struct {
// contains filtered or unexported fields
}
func (*SessionModel) Delete ¶
func (m *SessionModel) Delete(ctx context.Context, token string) error
func (*SessionModel) StartCleanup ¶
func (m *SessionModel) StartCleanup(interval time.Duration)
func (*SessionModel) StopCleanup ¶
func (m *SessionModel) StopCleanup()
Click to show internal directories.
Click to hide internal directories.