mirror of
https://github.com/status-im/consul.git
synced 2025-01-27 22:16:23 +00:00
state: remove unnecessary method receiver
This commit is contained in:
parent
650ac62098
commit
d70bbf671a
@ -123,7 +123,7 @@ func (s *ServiceIntentionSourceIndex) FromArgs(args ...interface{}) ([]byte, err
|
|||||||
return []byte(arg.String() + "\x00"), nil
|
return []byte(arg.String() + "\x00"), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Store) configIntentionsListTxn(tx ReadTxn, ws memdb.WatchSet, entMeta *structs.EnterpriseMeta) (uint64, structs.Intentions, bool, error) {
|
func configIntentionsListTxn(tx ReadTxn, ws memdb.WatchSet, entMeta *structs.EnterpriseMeta) (uint64, structs.Intentions, bool, error) {
|
||||||
// unrolled part of configEntriesByKindTxn
|
// unrolled part of configEntriesByKindTxn
|
||||||
|
|
||||||
idx := maxIndexTxn(tx, tableConfigEntries)
|
idx := maxIndexTxn(tx, tableConfigEntries)
|
||||||
@ -144,7 +144,7 @@ func (s *Store) configIntentionsListTxn(tx ReadTxn, ws memdb.WatchSet, entMeta *
|
|||||||
return idx, results, true, nil
|
return idx, results, true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Store) configIntentionGetTxn(tx ReadTxn, ws memdb.WatchSet, id string) (uint64, *structs.ServiceIntentionsConfigEntry, *structs.Intention, error) {
|
func configIntentionGetTxn(tx ReadTxn, ws memdb.WatchSet, id string) (uint64, *structs.ServiceIntentionsConfigEntry, *structs.Intention, error) {
|
||||||
idx := maxIndexTxn(tx, tableConfigEntries)
|
idx := maxIndexTxn(tx, tableConfigEntries)
|
||||||
if idx < 1 {
|
if idx < 1 {
|
||||||
idx = 1
|
idx = 1
|
||||||
|
@ -154,7 +154,7 @@ func (s *Store) LegacyIntentions(ws memdb.WatchSet, entMeta *structs.EnterpriseM
|
|||||||
tx := s.db.Txn(false)
|
tx := s.db.Txn(false)
|
||||||
defer tx.Abort()
|
defer tx.Abort()
|
||||||
|
|
||||||
idx, results, _, err := s.legacyIntentionsListTxn(tx, ws, entMeta)
|
idx, results, _, err := legacyIntentionsListTxn(tx, ws, entMeta)
|
||||||
return idx, results, err
|
return idx, results, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,12 +168,12 @@ func (s *Store) Intentions(ws memdb.WatchSet, entMeta *structs.EnterpriseMeta) (
|
|||||||
return 0, nil, false, err
|
return 0, nil, false, err
|
||||||
}
|
}
|
||||||
if !usingConfigEntries {
|
if !usingConfigEntries {
|
||||||
return s.legacyIntentionsListTxn(tx, ws, entMeta)
|
return legacyIntentionsListTxn(tx, ws, entMeta)
|
||||||
}
|
}
|
||||||
return s.configIntentionsListTxn(tx, ws, entMeta)
|
return configIntentionsListTxn(tx, ws, entMeta)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Store) legacyIntentionsListTxn(tx ReadTxn, ws memdb.WatchSet, entMeta *structs.EnterpriseMeta) (uint64, structs.Intentions, bool, error) {
|
func legacyIntentionsListTxn(tx ReadTxn, ws memdb.WatchSet, entMeta *structs.EnterpriseMeta) (uint64, structs.Intentions, bool, error) {
|
||||||
// Get the index
|
// Get the index
|
||||||
idx := maxIndexTxn(tx, tableConnectIntentions)
|
idx := maxIndexTxn(tx, tableConnectIntentions)
|
||||||
if idx < 1 {
|
if idx < 1 {
|
||||||
@ -578,13 +578,13 @@ func (s *Store) IntentionGet(ws memdb.WatchSet, id string) (uint64, *structs.Ser
|
|||||||
return 0, nil, nil, err
|
return 0, nil, nil, err
|
||||||
}
|
}
|
||||||
if !usingConfigEntries {
|
if !usingConfigEntries {
|
||||||
idx, ixn, err := s.legacyIntentionGetTxn(tx, ws, id)
|
idx, ixn, err := legacyIntentionGetTxn(tx, ws, id)
|
||||||
return idx, nil, ixn, err
|
return idx, nil, ixn, err
|
||||||
}
|
}
|
||||||
return s.configIntentionGetTxn(tx, ws, id)
|
return configIntentionGetTxn(tx, ws, id)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Store) legacyIntentionGetTxn(tx ReadTxn, ws memdb.WatchSet, id string) (uint64, *structs.Intention, error) {
|
func legacyIntentionGetTxn(tx ReadTxn, ws memdb.WatchSet, id string) (uint64, *structs.Intention, error) {
|
||||||
// Get the table index.
|
// Get the table index.
|
||||||
idx := maxIndexTxn(tx, tableConnectIntentions)
|
idx := maxIndexTxn(tx, tableConnectIntentions)
|
||||||
if idx < 1 {
|
if idx < 1 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user