summaryrefslogtreecommitdiff
path: root/internal/config/helpers.gen.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2022-06-23 16:54:54 +0200
committerLibravatar GitHub <noreply@github.com>2022-06-23 16:54:54 +0200
commit5f00d4980bdc55bce8d23e38392b345d525dbf4a (patch)
tree5300f3bbe38d7fcbf5ba07eda2c8c2142c573040 /internal/config/helpers.gen.go
parent[bugfix] Don't remove jpeg orientation metadata (#663) (diff)
downloadgotosocial-5f00d4980bdc55bce8d23e38392b345d525dbf4a.tar.xz
[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
Diffstat (limited to 'internal/config/helpers.gen.go')
-rw-r--r--internal/config/helpers.gen.go50
1 files changed, 50 insertions, 0 deletions
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()