Documentation ¶
Index ¶
- func Dir(useLocal bool, name string) http.FileSystem
- func FS(useLocal bool) http.FileSystem
- func FSByte(useLocal bool, name string) ([]byte, error)
- func FSMustByte(useLocal bool, name string) []byte
- func FSMustString(useLocal bool, name string) string
- func FSString(useLocal bool, name string) (string, error)
- func MaxMigrateVersion() (uint, error)
- func NewMigrateDSN(dsn string) (*migrate.Migrate, error)
- func NewMigrateInstance(db *sql.DB) (*migrate.Migrate, error)
- func WithInstance(fs http.FileSystem, config *Config) (source.Driver, error)
- type CommentOperator
- type Config
- type DBCommentOperator
- type DBEventOperator
- type DBOrganizationOperator
- type EventOperator
- type HttpFs
- func (f *HttpFs) Close() error
- func (f *HttpFs) First() (version uint, err error)
- func (f *HttpFs) Next(version uint) (nextVersion uint, err error)
- func (f *HttpFs) Open(url string) (source.Driver, error)
- func (f *HttpFs) Prev(version uint) (prevVersion uint, err error)
- func (f *HttpFs) ReadDown(version uint) (r io.ReadCloser, identifier string, err error)
- func (f *HttpFs) ReadUp(version uint) (r io.ReadCloser, identifier string, err error)
- type MemCommentOperator
- type MemEventOperator
- type NoopCommentOperator
- type NoopEventOperator
- type NoopOrganizationOperator
- type OrganizationOperator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dir ¶ added in v0.8.0
func Dir(useLocal bool, name string) http.FileSystem
Dir returns a http.Filesystem for the embedded assets on a given prefix dir. If useLocal is true, the filesystem's contents are instead used.
func FS ¶ added in v0.8.0
func FS(useLocal bool) http.FileSystem
FS returns a http.Filesystem for the embedded assets. If useLocal is true, the filesystem's contents are instead used.
func FSByte ¶ added in v0.8.0
FSByte returns the named file from the embedded assets. If useLocal is true, the filesystem's contents are instead used.
func FSMustByte ¶ added in v0.8.0
FSMustByte is the same as FSByte, but panics if name is not present.
func FSMustString ¶ added in v0.8.0
FSMustString is the string version of FSMustByte.
func MaxMigrateVersion ¶ added in v0.1.0
MaxMigrateVersion returns the current DB migration file version
func NewMigrateDSN ¶ added in v0.1.0
NewMigrateDSN returns a new Migrate instance from a database URL
func NewMigrateInstance ¶ added in v0.1.0
NewMigrateInstance returns a new Migrate instance from a postgres instance
func WithInstance ¶ added in v0.8.0
Types ¶
type CommentOperator ¶
type CommentOperator interface { // Save persists Comment in a store Save(context.Context, lookout.Event, *lookout.Comment, string) error // Posted checks if a comment was already posted for review Posted(context.Context, lookout.Event, *lookout.Comment) (bool, error) }
CommentOperator manages persistence of Comments
type DBCommentOperator ¶
type DBCommentOperator struct {
// contains filtered or unexported fields
}
DBCommentOperator operates on comments database store
func NewDBCommentOperator ¶
func NewDBCommentOperator( c *models.CommentStore, r *models.ReviewEventStore, rt *models.ReviewTargetStore, ) *DBCommentOperator
NewDBCommentOperator creates new DBCommentOperator using kallax as storage
type DBEventOperator ¶
type DBEventOperator struct {
// contains filtered or unexported fields
}
DBEventOperator operates on event database store
func NewDBEventOperator ¶
func NewDBEventOperator( r *models.ReviewEventStore, rt *models.ReviewTargetStore, p *models.PushEventStore, ) *DBEventOperator
NewDBEventOperator creates new DBEventOperator using kallax as storage
func (*DBEventOperator) Save ¶
func (o *DBEventOperator) Save(ctx context.Context, e lookout.Event) (models.EventStatus, error)
Save implements EventOperator interface
func (*DBEventOperator) UpdateStatus ¶
func (o *DBEventOperator) UpdateStatus(ctx context.Context, e lookout.Event, status models.EventStatus) error
UpdateStatus implements EventOperator interface
type DBOrganizationOperator ¶ added in v0.8.0
type DBOrganizationOperator struct {
// contains filtered or unexported fields
}
DBOrganizationOperator operates on an organization database store
func NewDBOrganizationOperator ¶ added in v0.8.0
func NewDBOrganizationOperator(store *models.OrganizationStore) *DBOrganizationOperator
NewDBOrganizationOperator creates new DBOrganizationOperator using kallax as storage
type EventOperator ¶
type EventOperator interface { // Save persists Event in a store and returns Status if event was persisted already Save(context.Context, lookout.Event) (models.EventStatus, error) // UpdateStatus updates Status of event in a store UpdateStatus(context.Context, lookout.Event, models.EventStatus) error }
EventOperator manages persistence of Events
type HttpFs ¶ added in v0.8.0
type HttpFs struct {
// contains filtered or unexported fields
}
type MemCommentOperator ¶
type MemCommentOperator struct {
// contains filtered or unexported fields
}
MemCommentOperator satisfies CommentOperator interface but does nothing
func NewMemCommentOperator ¶
func NewMemCommentOperator() *MemCommentOperator
NewMemCommentOperator creates new MemCommentOperator
type MemEventOperator ¶
type MemEventOperator struct {
// contains filtered or unexported fields
}
MemEventOperator satisfies EventOperator interface keeps events in memory
func NewMemEventOperator ¶
func NewMemEventOperator() *MemEventOperator
NewMemEventOperator creates new MemEventOperator
func (*MemEventOperator) Save ¶
func (o *MemEventOperator) Save(ctx context.Context, e lookout.Event) (models.EventStatus, error)
Save implements EventOperator interface
func (*MemEventOperator) UpdateStatus ¶
func (o *MemEventOperator) UpdateStatus(ctx context.Context, e lookout.Event, s models.EventStatus) error
UpdateStatus implements EventOperator interface
type NoopCommentOperator ¶
type NoopCommentOperator struct{}
NoopCommentOperator satisfies CommentOperator interface but does nothing
type NoopEventOperator ¶
type NoopEventOperator struct{}
NoopEventOperator satisfies EventOperator interface but does nothing
func (*NoopEventOperator) Save ¶
func (o *NoopEventOperator) Save(context.Context, lookout.Event) (models.EventStatus, error)
Save implements EventOperator interface and always returns New status
func (*NoopEventOperator) UpdateStatus ¶
func (o *NoopEventOperator) UpdateStatus(context.Context, lookout.Event, models.EventStatus) error
UpdateStatus implements EventOperator interface and does nothing
type NoopOrganizationOperator ¶ added in v0.8.0
type NoopOrganizationOperator struct{}
NoopOrganizationOperator satisfies OrganizationOperator interface but does nothing
type OrganizationOperator ¶ added in v0.8.0
type OrganizationOperator interface { // Save persists the given config, updating the current one if it exists // for the given (provider, orgID) Save(ctx context.Context, provider string, orgID string, config string) error // Config returns the stored config for the given (provider, orgID). If there // are no records in the DB, it returns "" without error. Config(ctx context.Context, provider string, orgID string) (string, error) }
OrganizationOperator manages persistence of default config for organizations