location

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_BLUETOOTH_PLACEHOLDER = "bluetooth herpader"
	BLUETOOTH_TYPE                = "Bluetooth"
)
View Source
const (
	DefaultNfcPlaceholder = "nfc herpader"
	NFCType               = "NFC"
)
View Source
const (
	WebsocketType = "WebSocket"
	// host tlvHelper position
	HostTlvType   = 0
	UseTlsTlvType = 1

	// indicate tls is used
	UseTlsEnumValueTrue = 0
	// indicate tls is not used
	UseTlsEnumFalse = 1

	// port tlvHelper position
	PortTlvType = 2
	// default wss port
	DefaultTlsPort = 443
	// default ws port
	DefaultNoTlsPort = 80
)
View Source
const (
	DefaultWebrtcPlaceholder = "webrtc herpader"
)
View Source
const PLACEHOLDER_TLV_TYPE = 0

default tlv type for unimplemented location beacons

Variables

This section is empty.

Functions

func EncodedPlaceHolderTlv

func EncodedPlaceHolderTlv(placeholder string) []byte

generate a placeholder tlv, return a byte slice representing tlv

func PlaceHolderTlv

func PlaceHolderTlv(placeholder string) tlv.Record

encode a placeholder tlv for python-parity tests

Types

type BluetoothLocation

type BluetoothLocation struct {
	PlaceholderString string
}

BluetoothLocation beacon - this is not currently implemented and is reserved for future use

func BluetoothLocationFromTlv

func BluetoothLocationFromTlv(tlv util.Tlv) (loc BluetoothLocation, err error)

decode a BluetoothLocation from a tlv object

func NewBluetoothLocation

func NewBluetoothLocation() BluetoothLocation

Create a new bluetooth location with the default header

func (BluetoothLocation) EncodedTlv

func (loc BluetoothLocation) EncodedTlv() []byte

get the encoded tlv of a given BluetoothLocation

func (BluetoothLocation) Tlv

func (loc BluetoothLocation) Tlv() []tlvHelper.Record

get the encoded tlv of a given BluetoothLocation

func (BluetoothLocation) ToObject

func (loc BluetoothLocation) ToObject() map[string]interface{}

encode the BluetoothLocation to a json-serializable map

func (BluetoothLocation) Type

func (loc BluetoothLocation) Type() tlvHelper.Type

Get the BluetoothLocation tlv type

type Location

type Location interface {
	// get the tlv.Type for a given location
	Type() tlv.Type
	// return the encoded tlv.Record for a given location
	Tlv() []tlv.Record
	// get the encoded tlv as a byte slice for a given location
	EncodedTlv() []byte
	// get a json-serializable object from the location
	ToObject() map[string]interface{}
}

type NfcLocation

type NfcLocation struct {
	PlaceholderString string
}

func NewNfcLocation

func NewNfcLocation() NfcLocation

func NfcLocationFromTlv

func NfcLocationFromTlv(tlv util.Tlv) (loc NfcLocation, err error)

func (NfcLocation) EncodedTlv

func (loc NfcLocation) EncodedTlv() []byte

func (NfcLocation) Tlv

func (loc NfcLocation) Tlv() []tlv.Record

func (NfcLocation) ToObject

func (loc NfcLocation) ToObject() map[string]interface{}

func (NfcLocation) Type

func (loc NfcLocation) Type() tlv.Type

type WebrtcLocation

type WebrtcLocation struct {
	PlaceholderString string
}

func NewWebRtcLocation

func NewWebRtcLocation() WebrtcLocation

func WebRtcLocationFromTlv

func WebRtcLocationFromTlv(tlv util.Tlv) (loc WebrtcLocation, err error)

func (WebrtcLocation) EncodedTlv

func (loc WebrtcLocation) EncodedTlv() []byte

func (WebrtcLocation) Tlv

func (loc WebrtcLocation) Tlv() []tlv.Record

func (WebrtcLocation) ToObject

func (loc WebrtcLocation) ToObject() map[string]interface{}

func (WebrtcLocation) Type

func (loc WebrtcLocation) Type() tlv.Type

type WebsocketLocation

type WebsocketLocation struct {
	// contains filtered or unexported fields
}

func NewWebsocketLocation

func NewWebsocketLocation(host string, useTls bool) WebsocketLocation

new websocket location

func NewWebsocketLocationPort

func NewWebsocketLocationPort(host string, useTls bool, port int) WebsocketLocation

func WebsocketLocationFromTlv

func WebsocketLocationFromTlv(tlv util.Tlv) (wsl WebsocketLocation, err error)

func (WebsocketLocation) EncodedTlv

func (ws WebsocketLocation) EncodedTlv() []byte

func (WebsocketLocation) IsTls

func (ws WebsocketLocation) IsTls() bool

func (WebsocketLocation) Tlv

func (ws WebsocketLocation) Tlv() []tlvHelper.Record

func (WebsocketLocation) ToObject

func (ws WebsocketLocation) ToObject() map[string]interface{}

func (WebsocketLocation) ToString

func (ws WebsocketLocation) ToString() string

func (WebsocketLocation) Type

func (ws WebsocketLocation) Type() tlvHelper.Type

Jump to

Keyboard shortcuts

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