nfc

package
v0.0.0-...-41cedfc Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package nfc is Near Field Communication (NFC) enables wireless communication between two devices at close proximity.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorEvent

type ErrorEvent struct {
	domcore.Event
}

class: NFCErrorEvent

func ErrorEventFromJS

func ErrorEventFromJS(value js.Value) *ErrorEvent

ErrorEventFromJS is casting a js.Value into ErrorEvent.

func ErrorEventFromWrapper

func ErrorEventFromWrapper(input core.Wrapper) *ErrorEvent

ErrorEventFromJS is casting from something that holds a js.Value into ErrorEvent.

func NewNFCErrorEvent

func NewNFCErrorEvent(_type string, errorEventInitDict *ErrorEventInit) (_result *ErrorEvent)

func (*ErrorEvent) Error

func (_this *ErrorEvent) Error() *domcore.DOMException

Error returning attribute 'error' with type domcore.DOMException (idl: DOMException).

type ErrorEventInit

type ErrorEventInit struct {
	Bubbles    bool
	Cancelable bool
	Composed   bool
	Error      *domcore.DOMException
}

dictionary: NFCErrorEventInit

func ErrorEventInitFromJS

func ErrorEventInitFromJS(value js.Value) *ErrorEventInit

ErrorEventInitFromJS is allocating a new ErrorEventInit object and copy all values in the value javascript object.

func (*ErrorEventInit) JSValue

func (_this *ErrorEventInit) JSValue() js.Value

JSValue is allocating a new javascript object and copy all values

type NDEFCompatibility

type NDEFCompatibility int

enum: NDEFCompatibility

const (
	CompatibilityNfcForum NDEFCompatibility = iota
	CompatibilityVendor
	CompatibilityAny
)

func NDEFCompatibilityFromJS

func NDEFCompatibilityFromJS(value js.Value) NDEFCompatibility

NDEFCompatibilityFromJS is converting a javascript value into a NDEFCompatibility enum value.

func (*NDEFCompatibility) JSValue

func (this *NDEFCompatibility) JSValue() js.Value

JSValue is converting this enum into a javascript object

func (NDEFCompatibility) Value

func (this NDEFCompatibility) Value() string

Value is converting this into javascript defined string value

type NDEFMessage

type NDEFMessage struct {
	Records []*NDEFRecord
	Url     string
}

dictionary: NDEFMessage

func NDEFMessageFromJS

func NDEFMessageFromJS(value js.Value) *NDEFMessage

NDEFMessageFromJS is allocating a new NDEFMessage object and copy all values in the value javascript object.

func (*NDEFMessage) JSValue

func (_this *NDEFMessage) JSValue() js.Value

JSValue is allocating a new javascript object and copy all values

type NDEFRecord

type NDEFRecord struct {
	RecordType NDEFRecordType
	MediaType  string
	Data       *Union
}

dictionary: NDEFRecord

func NDEFRecordFromJS

func NDEFRecordFromJS(value js.Value) *NDEFRecord

NDEFRecordFromJS is allocating a new NDEFRecord object and copy all values in the value javascript object.

func (*NDEFRecord) JSValue

func (_this *NDEFRecord) JSValue() js.Value

JSValue is allocating a new javascript object and copy all values

type NDEFRecordType

type NDEFRecordType int

enum: NDEFRecordType

const (
	RecordEmpty NDEFRecordType = iota
	RecordText
	RecordUrl
	RecordJson
	RecordOpaque
)

func NDEFRecordTypeFromJS

func NDEFRecordTypeFromJS(value js.Value) NDEFRecordType

NDEFRecordTypeFromJS is converting a javascript value into a NDEFRecordType enum value.

func (*NDEFRecordType) JSValue

func (this *NDEFRecordType) JSValue() js.Value

JSValue is converting this enum into a javascript object

func (NDEFRecordType) Value

func (this NDEFRecordType) Value() string

Value is converting this into javascript defined string value

type PushOptions

type PushOptions struct {
	Target        PushTarget
	Timeout       float64
	IgnoreRead    bool
	Signal        *domcore.AbortSignal
	Compatibility NDEFCompatibility
}

dictionary: NFCPushOptions

func PushOptionsFromJS

func PushOptionsFromJS(value js.Value) *PushOptions

PushOptionsFromJS is allocating a new PushOptions object and copy all values in the value javascript object.

func (*PushOptions) JSValue

func (_this *PushOptions) JSValue() js.Value

JSValue is allocating a new javascript object and copy all values

type PushTarget

type PushTarget int

enum: NFCPushTarget

const (
	PushTargetTag PushTarget = iota
	PushTargetPeer
	PushTargetAny
)

func PushTargetFromJS

func PushTargetFromJS(value js.Value) PushTarget

PushTargetFromJS is converting a javascript value into a PushTarget enum value.

func (*PushTarget) JSValue

func (this *PushTarget) JSValue() js.Value

JSValue is converting this enum into a javascript object

func (PushTarget) Value

func (this PushTarget) Value() string

Value is converting this into javascript defined string value

type Reader

type Reader struct {
	domcore.EventTarget
}

class: NFCReader

func NewNFCReader

func NewNFCReader(options *ReaderOptions) (_result *Reader)

func ReaderFromJS

func ReaderFromJS(value js.Value) *Reader

ReaderFromJS is casting a js.Value into Reader.

func ReaderFromWrapper

func ReaderFromWrapper(input core.Wrapper) *Reader

ReaderFromJS is casting from something that holds a js.Value into Reader.

func (*Reader) AddEventError

func (_this *Reader) AddEventError(listener func(event *ErrorEvent, currentTarget *Reader)) js.Func

AddError is adding doing AddEventListener for 'Error' on target. This method is returning allocated javascript function that need to be released.

func (*Reader) AddEventReading

func (_this *Reader) AddEventReading(listener func(event *ReadingEvent, currentTarget *Reader)) js.Func

AddReading is adding doing AddEventListener for 'Reading' on target. This method is returning allocated javascript function that need to be released.

func (*Reader) OnError

func (_this *Reader) OnError() domcore.EventHandlerFunc

OnError returning attribute 'onerror' with type domcore.EventHandler (idl: EventHandlerNonNull).

func (*Reader) OnReading

func (_this *Reader) OnReading() domcore.EventHandlerFunc

OnReading returning attribute 'onreading' with type domcore.EventHandler (idl: EventHandlerNonNull).

func (*Reader) SetOnError

func (_this *Reader) SetOnError(listener func(event *ErrorEvent, currentTarget *Reader)) js.Func

SetOnError is assigning a function to 'onerror'. This This method is returning allocated javascript function that need to be released.

func (*Reader) SetOnReading

func (_this *Reader) SetOnReading(listener func(event *ReadingEvent, currentTarget *Reader)) js.Func

SetOnReading is assigning a function to 'onreading'. This This method is returning allocated javascript function that need to be released.

func (*Reader) Start

func (_this *Reader) Start()

func (*Reader) Stop

func (_this *Reader) Stop()

type ReaderOptions

type ReaderOptions struct {
	Url           string
	RecordType    NDEFRecordType
	MediaType     string
	Compatibility NDEFCompatibility
}

dictionary: NFCReaderOptions

func ReaderOptionsFromJS

func ReaderOptionsFromJS(value js.Value) *ReaderOptions

ReaderOptionsFromJS is allocating a new ReaderOptions object and copy all values in the value javascript object.

func (*ReaderOptions) JSValue

func (_this *ReaderOptions) JSValue() js.Value

JSValue is allocating a new javascript object and copy all values

type ReadingEvent

type ReadingEvent struct {
	domcore.Event
}

class: NFCReadingEvent

func NewNFCReadingEvent

func NewNFCReadingEvent(_type string, readingEventInitDict *ReadingEventInit) (_result *ReadingEvent)

func ReadingEventFromJS

func ReadingEventFromJS(value js.Value) *ReadingEvent

ReadingEventFromJS is casting a js.Value into ReadingEvent.

func ReadingEventFromWrapper

func ReadingEventFromWrapper(input core.Wrapper) *ReadingEvent

ReadingEventFromJS is casting from something that holds a js.Value into ReadingEvent.

func (*ReadingEvent) Message

func (_this *ReadingEvent) Message() *NDEFMessage

Message returning attribute 'message' with type NDEFMessage (idl: NDEFMessage).

type ReadingEventInit

type ReadingEventInit struct {
	Bubbles    bool
	Cancelable bool
	Composed   bool
	Message    *NDEFMessage
}

dictionary: NFCReadingEventInit

func ReadingEventInitFromJS

func ReadingEventInitFromJS(value js.Value) *ReadingEventInit

ReadingEventInitFromJS is allocating a new ReadingEventInit object and copy all values in the value javascript object.

func (*ReadingEventInit) JSValue

func (_this *ReadingEventInit) JSValue() js.Value

JSValue is allocating a new javascript object and copy all values

type Union

type Union struct {
	Value js.Value
}

func UnionFromJS

func UnionFromJS(value js.Value) *Union

func (*Union) JSValue

func (u *Union) JSValue() js.Value

type Writer

type Writer struct {
	// Value_JS holds a reference to a javascript value
	Value_JS js.Value
}

class: NFCWriter

func NewNFCWriter

func NewNFCWriter() (_result *Writer)

func WriterFromJS

func WriterFromJS(value js.Value) *Writer

WriterFromJS is casting a js.Value into Writer.

func WriterFromWrapper

func WriterFromWrapper(input core.Wrapper) *Writer

WriterFromJS is casting from something that holds a js.Value into Writer.

func (*Writer) JSValue

func (_this *Writer) JSValue() js.Value

JSValue returns the js.Value or js.Null() if _this is nil

func (*Writer) Push

func (_this *Writer) Push(message *Union, options *PushOptions) (_result *javascript.PromiseVoid)

Jump to

Keyboard shortcuts

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