Add entity information request to system view (#4681)

* Add entity information request to system view

* fixing a few comments

* sharing types between plugin and logical

* sharing types between plugin and logical

* fixing output directory for proto

* removing extra replacement

* adding mount type lookup

* empty entities return nil instead of error

* adding some comments
This commit is contained in:
Chris Hoffman
2018-06-03 20:48:12 -04:00
committed by GitHub
parent bacd506163
commit 51bc3d8891
13 changed files with 680 additions and 308 deletions

View File

@@ -57,6 +57,10 @@ type SystemView interface {
// MlockEnabled returns the configuration setting for enabling mlock on
// plugins.
MlockEnabled() bool
// EntityInfo returns a subset of information related to the identity entity
// for the given entity id
EntityInfo(entityID string) (*Entity, error)
}
type StaticSystemView struct {
@@ -69,6 +73,7 @@ type StaticSystemView struct {
EnableMlock bool
LocalMountVal bool
ReplicationStateVal consts.ReplicationState
EntityVal *Entity
}
func (d StaticSystemView) DefaultLeaseTTL() time.Duration {
@@ -110,3 +115,7 @@ func (d StaticSystemView) LookupPlugin(_ context.Context, name string) (*pluginu
func (d StaticSystemView) MlockEnabled() bool {
return d.EnableMlock
}
func (d StaticSystemView) EntityInfo(entityID string) (*Entity, error) {
return d.EntityVal, nil
}