connection

package
v0.171.3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2023 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

This section is empty.

Types

type State

type State struct {
	Offline   bool `json:"offline"`
	Type      Type `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.

type Type added in v0.97.4

type Type byte

Type represents description of available connection types as reported by React Native (see https://facebook.github.io/react-native/docs/netinfo.html) We're interested mainly in 'wifi' and 'cellular', but other types are also may be used.

func NewType added in v0.97.4

func NewType(s string) Type

NewType creates new Type from string.

Jump to

Keyboard shortcuts

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