Skip to content

Commit

Permalink
rethink: updated godoc annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
arekkas authored Sep 23, 2016
1 parent f3f8e52 commit 45f76fd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions manager_rethink.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func rdbFromPolicy(p Policy) (*rdbSchema, error) {
}, err
}

// RethinkManager is a rethinkdb implementation of Manager to store policies persistently
// RethinkManager is a rethinkdb implementation of Manager to store policies persistently.
type RethinkManager struct {
Session *r.Session
Table r.Term
Expand All @@ -71,7 +71,7 @@ type RethinkManager struct {
Policies map[string]Policy
}

// ColdStart loads all policies from rethinkdb without warming up the cache
// ColdStart loads all policies from rethinkdb into memory.
func (m *RethinkManager) ColdStart() error {
m.Policies = map[string]Policy{}
policies, err := m.Table.Run(m.Session)
Expand All @@ -93,7 +93,7 @@ func (m *RethinkManager) ColdStart() error {
return nil
}

// Create inserts a new policy
// Create inserts a new policy.
func (m *RethinkManager) Create(policy Policy) error {
if err := m.publishCreate(policy); err != nil {
return err
Expand Down Expand Up @@ -124,7 +124,7 @@ func (m *RethinkManager) Delete(id string) error {
return nil
}

// FindPoliciesForSubject returns Policies (an array of policy) for a given subject
// FindPoliciesForSubject returns Policies (an array of policy) for a given subject.
func (m *RethinkManager) FindPoliciesForSubject(subject string) (Policies, error) {
m.RLock()
defer m.RUnlock()
Expand Down Expand Up @@ -177,7 +177,7 @@ func (m *RethinkManager) publishDelete(id string) error {
}

// Watch is used to watch for changes on rethinkdb (which happens
// asynchronous) and updates manager's policy accordingly
// asynchronous) and updates manager's policy accordingly.
func (m *RethinkManager) Watch(ctx context.Context) {
go retry(time.Second*15, time.Minute, func() error {
policies, err := m.Table.Changes().Run(m.Session)
Expand Down

0 comments on commit 45f76fd

Please sign in to comment.