Documentation
¶
Index ¶
Constants ¶
View Source
const ( FilterMaxBytes = 65535 FilterMaxAuthors = 950 MaxConcurrentReqs = 10 MaxConcurrentSyncs = 10 DefaultRouterTimeout = "600" )
Variables ¶
View Source
var ( UnsupportedMsgs = []string{ "ERROR: negentropy error: negentropy query missing elements", "ERROR: bad msg: negentropy disabled", "ERROR: bad msg: invalid message", "bad message type", `invalid: \"value\" does not match any of the allowed types`, "Command unrecognized", "error: bad message", "could not parse command", "unknown message type NEG-OPEN", "ERROR: bad msg: unknown cmd", } UnexpectedReg = regexp.MustCompile("^(.*)Unexpected message from relay: \\[\"NOTICE\"\\,") )
Functions ¶
Types ¶
type ConcurrentCounter ¶
type ConcurrentCounter struct {
// contains filtered or unexported fields
}
func (*ConcurrentCounter) Begin ¶
func (g *ConcurrentCounter) Begin()
func (*ConcurrentCounter) Done ¶
func (g *ConcurrentCounter) Done()
func (*ConcurrentCounter) Value ¶
func (g *ConcurrentCounter) Value() int
func (*ConcurrentCounter) Wait ¶
func (g *ConcurrentCounter) Wait(max int)
type Config ¶
type Config struct {
LogLevel string `koanf:"log-level"`
PluginDown string `koanf:"plugin-down"`
PluginConfig string `koanf:"plugin-config"`
RouterTimeout string `koanf:"router-timeout"`
RouterConfig string `koanf:"router-config"`
SyncConfig string `koanf:"sync-config"`
SyncStatusFile string `koanf:"sync-status-file"`
StrFryLog string `koanf:"sync-strfry-log"`
StrFryBin string `koanf:"sync-strfry"`
StrFryConfig string `koanf:"sync-strfry-config"`
DiscoveryRelays []string `koanf:"discovery-relays"`
Users []User `koanf:"users"`
}
type DownPlugin ¶
type DownPlugin struct {
AuthorAllow []string `json:"author-allow"`
// contains filtered or unexported fields
}
func NewDownPlugin ¶
func NewDownPlugin() *DownPlugin
func (*DownPlugin) AppendUniqueAuthor ¶
func (g *DownPlugin) AppendUniqueAuthor(pubkey string)
type Filter ¶
func (*Filter) AppendUniqueAuthor ¶
func (*Filter) AuthorLength ¶
func (*Filter) MarshalJSON ¶
func (*Filter) UnmarshalJSON ¶
type RouterConfig ¶
type RouterConfig struct {
Streams map[string]*RouterStream `json:"streams"`
Timeout string `json:"connectionTimeout"`
// contains filtered or unexported fields
}
func (*RouterConfig) AddUser ¶
func (g *RouterConfig) AddUser( cfg *Config, user *User, relays []string, contacts []string)
func (*RouterConfig) PluginAppendUniqueAuthor ¶
func (g *RouterConfig) PluginAppendUniqueAuthor(pubkey string)
func (*RouterConfig) WritePluginConfig ¶
func (g *RouterConfig) WritePluginConfig(path string) error
type RouterStream ¶
type RouterStream struct {
Direction string `json:"dir"`
PluginDown string `json:"pluginDown,omitempty"`
PluginUp string `json:"pluginUp,omitempty"`
Relays []string `json:"urls"`
Filter *Filter `json:"filter,omitempty"`
// contains filtered or unexported fields
}
func NewRouterStream ¶
func NewRouterStream(dir string, pluginPath string) *RouterStream
func (*RouterStream) AppendUniqueRelay ¶
func (g *RouterStream) AppendUniqueRelay(relay string)
type SyncConfig ¶
type SyncConfig struct {
LogLevel string `koanf:"log-level" json:"log-level"`
StrFryBin string `koanf:"strfry-bin" json:"strfry-bin"`
StrFryConfig string `koanf:"strfry-config" json:"strfry-config"`
StrFryLog string `koanf:"strfry-log" json:"strfry-log"`
StatusFile string `koanf:"status-file" json:"status-file"`
Users []*SyncUser `koanf:"users" json:"users"`
// contains filtered or unexported fields
}
func NewSyncConfig ¶
func NewSyncConfig() SyncConfig
func (*SyncConfig) AppendUniqueUser ¶
func (g *SyncConfig) AppendUniqueUser(user *SyncUser)
Click to show internal directories.
Click to hide internal directories.
