connection

package
v0.94.10 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 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