Documentation
¶
Overview ¶
Helper functions for iwebd
This package contains common helper functions used across iwebd. Not meant for consumption by other projects.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Log *logger.Logger = logger.NewLogger()
Functions ¶
func GenKeyPair ¶
func GenKeyPair() tls.Certificate
Generate a temporary, self-signed certificate/key pair for iwebd servers.
func ShowInterfaces ¶
Output information about how to reach a listener.
func SizeToHumanReadableSize ¶
Return a human-readable representation of a file size.
func WaitToQuit ¶
func WaitToQuit(appQuit <-chan int)
Helper function to allow servers to wait for either the server quitting or the user to interrupt the process, and then still cleaning up.
Types ¶
type BonjourService ¶
type BonjourService struct {
// contains filtered or unexported fields
}
Wrapper around the Bonjour implementation
func RegisterBonjour ¶
func RegisterBonjour(service string, txt []string, listenerAddr net.Addr) (svr *BonjourService)
Register a new service to be announced via Bonjour.
Arguments are the Bonjour service name, additional text parameters, and the listener of the service to allow this function to decide which interfaces to announce the service on.
func (*BonjourService) Shutdown ¶
func (s *BonjourService) Shutdown()
type ColonSeparated ¶
type ColonSeparated struct {
// contains filtered or unexported fields
}
A cobra.Value implementation accepting and parsing a val1:val2 combination
func (*ColonSeparated) IsSet ¶
func (v *ColonSeparated) IsSet() bool
func (*ColonSeparated) Set ¶
func (v *ColonSeparated) Set(arg string) error
func (*ColonSeparated) String ¶
func (v *ColonSeparated) String() string
func (*ColonSeparated) Type ¶
func (v *ColonSeparated) Type() string