Documentation ¶
Index ¶
- func Event(targetRepositoryID string, event *api.WebhookEvent) error
- func InitCache(repositoryIDs string, redisConfig *RedisConfig) []string
- func InternalEvent(targetRepositoryID string, eventBodyBytes []byte, headers http.Header) (bool, error)
- func NewInMemoryStore() *inMemoryStore
- func NewRedisStore(config *RedisConfig) *redisStore
- func PrepareForShutdown()
- type EventStore
- type RedisConfig
- type RepositoryWatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitCache ¶
func InitCache(repositoryIDs string, redisConfig *RedisConfig) []string
func InternalEvent ¶
func NewInMemoryStore ¶
func NewInMemoryStore() *inMemoryStore
func NewRedisStore ¶
func NewRedisStore(config *RedisConfig) *redisStore
func PrepareForShutdown ¶
func PrepareForShutdown()
TODO should probably have some logic for closing the stores for example, disconnecting the Redis client if it is connected
Types ¶
type EventStore ¶
type EventStore interface { Store(repositoryId string, event *api.WebhookEventInternal) bool Remove(repositoryId string, event *api.WebhookEventInternal) bool RetrieveEventsForRepository(repositoryId string) []*api.WebhookEventInternal CountEventsForRepository(repositoryId string) int IsConnected() bool }
var Store EventStore
type RedisConfig ¶
type RepositoryWatcher ¶
type RepositoryWatcher struct {
Repositories []string
}
var Repositories RepositoryWatcher
func (*RepositoryWatcher) AddRepository ¶
func (r *RepositoryWatcher) AddRepository(repositoryId string)
func (*RepositoryWatcher) ReportWatchedRepositories ¶
func (r *RepositoryWatcher) ReportWatchedRepositories()
func (*RepositoryWatcher) RepositoryIsWatched ¶
func (r *RepositoryWatcher) RepositoryIsWatched(repositoryID string) bool
Click to show internal directories.
Click to hide internal directories.