Documentation
¶
Index ¶
Constants ¶
const ( DiscoveryPort = 8081 BroadcastInterval = 30 * time.Second DiscoveryMagic = "GOFLUX-LITE-DISCOVERY" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiscoveryInfo ¶ added in v0.1.1
type DiscoveryInfo struct {
Name string `json:"name"`
Version string `json:"version"`
Address string `json:"address"`
Port string `json:"port"`
AuthEnabled bool `json:"auth_enabled"`
Timestamp int64 `json:"timestamp"`
}
DiscoveryInfo represents server information broadcast on the network
type DiscoveryService ¶ added in v0.1.1
type DiscoveryService struct {
// contains filtered or unexported fields
}
DiscoveryService handles UDP broadcast announcements
func NewDiscoveryService ¶ added in v0.1.1
func NewDiscoveryService(serverAddress, version string, authEnabled bool) (*DiscoveryService, error)
NewDiscoveryService creates a new discovery service
func (*DiscoveryService) Start ¶ added in v0.1.1
func (d *DiscoveryService) Start()
Start begins broadcasting server information
func (*DiscoveryService) Stop ¶ added in v0.1.1
func (d *DiscoveryService) Stop()
Stop halts the discovery service
type FirewallManager ¶ added in v0.1.1
type FirewallManager struct {
// contains filtered or unexported fields
}
FirewallManager handles automatic firewall rule creation
func NewFirewallManager ¶ added in v0.1.1
func NewFirewallManager(serverPort, discoveryPort int) *FirewallManager
NewFirewallManager creates a new firewall manager
func (*FirewallManager) EnsureFirewallRules ¶ added in v0.1.1
func (fm *FirewallManager) EnsureFirewallRules()
EnsureFirewallRules automatically creates firewall rules if needed
func (*FirewallManager) RemoveFirewallRules ¶ added in v0.1.1
func (fm *FirewallManager) RemoveFirewallRules()
RemoveFirewallRules removes the firewall rules (cleanup)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a goflux server instance.
func (*Server) EnableAuth ¶
func (s *Server) EnableAuth(tokenStore *auth.TokenStore)
EnableAuth enables authentication on the server
func (*Server) EnableDiscovery ¶ added in v0.1.1
EnableDiscovery enables the discovery service
func (*Server) EnableFirewall ¶ added in v0.1.1
EnableFirewall enables automatic firewall configuration
func (*Server) SetConfig ¶ added in v0.1.1
func (s *Server) SetConfig(config *ServerConfig)
SetConfig sets the server configuration to share with clients
type ServerConfig ¶ added in v0.1.1
type ServerConfig struct {
Server struct {
Address string `json:"address"`
StorageDir string `json:"storage_dir"`
MetaDir string `json:"meta_dir"`
TokensFile string `json:"tokens_file,omitempty"`
MaxFileSize int64 `json:"max_file_size"`
} `json:"server"`
Version string `json:"version"`
AuthEnabled bool `json:"auth_enabled"`
}
ServerConfig represents server configuration that can be shared with clients
type UploadStatusResponse ¶
type UploadStatusResponse struct {
Exists bool `json:"exists"` // whether a session exists
TotalChunks int `json:"total_chunks"` // total chunks expected
ReceivedMap []bool `json:"received_map"` // bitmap of received chunks
MissingChunks []int `json:"missing_chunks"` // list of missing chunk IDs
Completed bool `json:"completed"` // upload completed
}
UploadStatusResponse contains the status of an upload session