From 5f00d4980bdc55bce8d23e38392b345d525dbf4a Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Thu, 23 Jun 2022 16:54:54 +0200 Subject: [feature] Implement `/api/v1/instance/peers` endpoint (#660) * add missing license headers * start adding instance peers get * rename domainblock.go * embed domain in domainblock so it can be reused * update swagger docs * add test instances to db * update tests * add/update instancepeersget * update domain model * add getinstancepeers to db * instance-expose-peers, instance-expose-suspended * add auth checks for both current filters * attach endpoint to router * include public comment * obfuscate domain if required * go mod tidy * update swagger docs * remove unnecessary comment * return 'flat' peerlist if no query params provided --- internal/config/helpers.gen.go | 50 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'internal/config/helpers.gen.go') diff --git a/internal/config/helpers.gen.go b/internal/config/helpers.gen.go index a48828059..a4c2adebf 100644 --- a/internal/config/helpers.gen.go +++ b/internal/config/helpers.gen.go @@ -543,6 +543,56 @@ func GetWebAssetBaseDir() string { return global.GetWebAssetBaseDir() } // SetWebAssetBaseDir safely sets the value for global configuration 'WebAssetBaseDir' field func SetWebAssetBaseDir(v string) { global.SetWebAssetBaseDir(v) } +// GetInstanceExposePeers safely fetches the Configuration value for state's 'InstanceExposePeers' field +func (st *ConfigState) GetInstanceExposePeers() (v bool) { + st.mutex.Lock() + v = st.config.InstanceExposePeers + st.mutex.Unlock() + return +} + +// SetInstanceExposePeers safely sets the Configuration value for state's 'InstanceExposePeers' field +func (st *ConfigState) SetInstanceExposePeers(v bool) { + st.mutex.Lock() + defer st.mutex.Unlock() + st.config.InstanceExposePeers = v + st.reloadToViper() +} + +// InstanceExposePeersFlag returns the flag name for the 'InstanceExposePeers' field +func InstanceExposePeersFlag() string { return "instance-expose-peers" } + +// GetInstanceExposePeers safely fetches the value for global configuration 'InstanceExposePeers' field +func GetInstanceExposePeers() bool { return global.GetInstanceExposePeers() } + +// SetInstanceExposePeers safely sets the value for global configuration 'InstanceExposePeers' field +func SetInstanceExposePeers(v bool) { global.SetInstanceExposePeers(v) } + +// GetInstanceExposeSuspended safely fetches the Configuration value for state's 'InstanceExposeSuspended' field +func (st *ConfigState) GetInstanceExposeSuspended() (v bool) { + st.mutex.Lock() + v = st.config.InstanceExposeSuspended + st.mutex.Unlock() + return +} + +// SetInstanceExposeSuspended safely sets the Configuration value for state's 'InstanceExposeSuspended' field +func (st *ConfigState) SetInstanceExposeSuspended(v bool) { + st.mutex.Lock() + defer st.mutex.Unlock() + st.config.InstanceExposeSuspended = v + st.reloadToViper() +} + +// InstanceExposeSuspendedFlag returns the flag name for the 'InstanceExposeSuspended' field +func InstanceExposeSuspendedFlag() string { return "instance-expose-suspended" } + +// GetInstanceExposeSuspended safely fetches the value for global configuration 'InstanceExposeSuspended' field +func GetInstanceExposeSuspended() bool { return global.GetInstanceExposeSuspended() } + +// SetInstanceExposeSuspended safely sets the value for global configuration 'InstanceExposeSuspended' field +func SetInstanceExposeSuspended(v bool) { global.SetInstanceExposeSuspended(v) } + // GetAccountsRegistrationOpen safely fetches the Configuration value for state's 'AccountsRegistrationOpen' field func (st *ConfigState) GetAccountsRegistrationOpen() (v bool) { st.mutex.Lock() -- cgit v1.2.3