connection

package
v0.83.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 3, 2021 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Offline  = "offline"
	Wifi     = "wifi"
	Cellular = "cellular"
	Unknown  = "unknown"
	None     = "none"
)

Variables

This section is empty.

Functions

func NewConnectionType

func NewConnectionType(s string) connectionType

NewConnectionType creates new connectionType from string.

Types

type State

type State struct {
	Offline   bool           `json:"offline"`
	Type      connectionType `json:"type"`
	Expensive bool           `json:"expensive"`
}

State represents device connection state and type, as reported by mobile framework.

Zero value represents default assumption about network (online and unknown type).

func (State) IsExpensive

func (c State) IsExpensive() bool

func (State) String

func (c State) String() string

string formats ConnectionState for logs. Implements Stringer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL