Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
Application runs the different parts of the program together (UI, Network...)
func NewApplication ¶
func NewApplication() *Application
NewApplication creates an Application with initialized internals
func (*Application) Run ¶
func (app *Application) Run(address string)
Run starts the internals and ensure they stop correctly, `address` is the initial Gopher server requested
type Network ¶
type Network struct {
// contains filtered or unexported fields
}
Network starts its own thread to handle network requests asynchronously
func NewNetwork ¶
func NewNetwork() *Network
NewNetwork builds a valid Network structure with channels, etc
func (*Network) Request ¶
func (network *Network) Request(address string) <-chan *NetworkEvent
Request sends a cancel event for the current request and starts a new request to the provided `address`
type NetworkEvent ¶
type NetworkEvent struct { Event NetworkEventType Result *NetworkResult ResultHTML *NetworkResultHTML ResultError error }
NetworkEvent represents any answer from the Network
type NetworkEventType ¶
type NetworkEventType int
NetworkEventType is a type of event that be returned by the NetworkManager
const ( NetworkEventOK NetworkEventType = iota NetworkEventHTML NetworkEventError )
Type of possible network results
type NetworkManager ¶
type NetworkManager interface {
Request(string) <-chan *NetworkEvent
}
NetworkManager is a class that can do Gopher requests
type NetworkResult ¶
NetworkResult is a Gopher answer from a request to the NetworkManager class
type NetworkResultHTML ¶
NetworkResultHTML is a HTML answer from a request to the NetworkManager class