Documentation ¶
Index ¶
- func Close() error
- type Cache
- func (cache *Cache) Close() error
- func (cache *Cache) CountIssues(p *gitlab.Project, opts *gitlab.IssuesStreamOpts) int
- func (cache *Cache) CountKeys(namespace []byte) int
- func (cache *Cache) Delete(e *Entry) error
- func (cache *Cache) Get(namespace []byte, key int, value interface{}) error
- func (cache *Cache) GetIssue(p *gitlab.Project, id int) (*gitlab.Issue, error)
- func (cache *Cache) GetIssuesStream(p *gitlab.Project, opts *gitlab.IssuesStreamOpts, issueChan chan *gitlab.Issue) error
- func (cache *Cache) GetIssuesUpdatedAt(p *gitlab.Project) *time.Time
- func (cache *Cache) GetStream(namespace []byte, valueChan chan []byte) error
- func (cache *Cache) RegisterHook(hook Hook)
- func (cache *Cache) Set(e *Entry) error
- func (cache *Cache) SetIssuesUpdatedAt(p *gitlab.Project, u *time.Time) error
- func (cache *Cache) SetStream(done chan struct{}, entryChan chan *Entry) error
- func (cache *Cache) UpdateIssue(p *gitlab.Project, i *gitlab.Issue) error
- func (cache *Cache) UpdateIssuesStream(done chan struct{}, p *gitlab.Project, issueChan chan *gitlab.Issue) error
- type DB
- type Entry
- type Hook
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) CountIssues ¶
func (*Cache) Delete ¶
Delete removes the key, and calls each deleteHook with the key. Hooks are not guarenteed to run, as an earlier hook might error before it ran.
func (*Cache) Get ¶
Get will retrieve the data from the database, and unmarshal it into the value passed in as last argument. Make sure that value is a pointer receiver.
func (*Cache) GetIssuesStream ¶
func (cache *Cache) GetIssuesStream(p *gitlab.Project, opts *gitlab.IssuesStreamOpts, issueChan chan *gitlab.Issue) error
Implements IssuesReader interface
func (*Cache) GetIssuesUpdatedAt ¶
func (*Cache) RegisterHook ¶
RegisterHook registers the provided hook that will be called during cache Set and SetStream operations
func (*Cache) Set ¶
Set will write the value to the key, scoped to the namespace. Once the write is commited, the hooks will run. Hooks are not guarenteed to run, as an earlier hook might return an error.
func (*Cache) SetIssuesUpdatedAt ¶
func (*Cache) UpdateIssue ¶
Implements IssueWriter interface
type Hook ¶
type Hook interface { PostWrite(namespace []byte, key int, value interface{}) error PostDelete(namespace []byte, key int) error // PostBatchWrite is indented to allow the hook to run in batches, where // the control of when the hook runs remains in the control of the hook. PostBatchWrite(namespace []byte, key int, value interface{}) error // Hooks can depend on BatchFlush being called when the current batch is // done. BatchFlush() error io.Closer }
Hook is a minimal interface that does not, and can't depend on Entry