Documentation ¶
Overview ¶
Package nfc is Near Field Communication (NFC) enables wireless communication between two devices at close proximity.
Index ¶
- type ErrorEvent
- type ErrorEventInit
- type NDEFCompatibility
- type NDEFMessage
- type NDEFRecord
- type NDEFRecordType
- type PushOptions
- type PushTarget
- type Reader
- func (_this *Reader) AddEventError(listener func(event *ErrorEvent, currentTarget *Reader)) js.Func
- func (_this *Reader) AddEventReading(listener func(event *ReadingEvent, currentTarget *Reader)) js.Func
- func (_this *Reader) OnError() domcore.EventHandlerFunc
- func (_this *Reader) OnReading() domcore.EventHandlerFunc
- func (_this *Reader) SetOnError(listener func(event *ErrorEvent, currentTarget *Reader)) js.Func
- func (_this *Reader) SetOnReading(listener func(event *ReadingEvent, currentTarget *Reader)) js.Func
- func (_this *Reader) Start()
- func (_this *Reader) Stop()
- type ReaderOptions
- type ReadingEvent
- type ReadingEventInit
- type Union
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorEvent ¶
class: NFCErrorEvent
func ErrorEventFromJS ¶
func ErrorEventFromJS(value js.Wrapper) *ErrorEvent
ErrorEventFromJS is casting a js.Wrapper 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.Wrapper) *ErrorEventInit
ErrorEventInitFromJS is allocating a new ErrorEventInit object and copy all values from input javascript object
func (*ErrorEventInit) JSValue ¶
func (_this *ErrorEventInit) JSValue() js.Value
JSValue is allocating a new javasript 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.Wrapper) *NDEFMessage
NDEFMessageFromJS is allocating a new NDEFMessage object and copy all values from input javascript object
func (*NDEFMessage) JSValue ¶
func (_this *NDEFMessage) JSValue() js.Value
JSValue is allocating a new javasript object and copy all values
type NDEFRecord ¶
type NDEFRecord struct { RecordType NDEFRecordType MediaType string Data *Union }
dictionary: NDEFRecord
func NDEFRecordFromJS ¶
func NDEFRecordFromJS(value js.Wrapper) *NDEFRecord
NDEFRecordFromJS is allocating a new NDEFRecord object and copy all values from input javascript object
func (*NDEFRecord) JSValue ¶
func (_this *NDEFRecord) JSValue() js.Value
JSValue is allocating a new javasript 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.Wrapper) *PushOptions
PushOptionsFromJS is allocating a new PushOptions object and copy all values from input javascript object
func (*PushOptions) JSValue ¶
func (_this *PushOptions) JSValue() js.Value
JSValue is allocating a new javasript 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 ¶
ReaderFromJS is casting a js.Wrapper 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.
type ReaderOptions ¶
type ReaderOptions struct { Url string RecordType NDEFRecordType MediaType string Compatibility NDEFCompatibility }
dictionary: NFCReaderOptions
func ReaderOptionsFromJS ¶
func ReaderOptionsFromJS(value js.Wrapper) *ReaderOptions
ReaderOptionsFromJS is allocating a new ReaderOptions object and copy all values from input javascript object
func (*ReaderOptions) JSValue ¶
func (_this *ReaderOptions) JSValue() js.Value
JSValue is allocating a new javasript object and copy all values
type ReadingEvent ¶
class: NFCReadingEvent
func NewNFCReadingEvent ¶
func NewNFCReadingEvent(_type string, readingEventInitDict *ReadingEventInit) (_result *ReadingEvent)
func ReadingEventFromJS ¶
func ReadingEventFromJS(value js.Wrapper) *ReadingEvent
ReadingEventFromJS is casting a js.Wrapper 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.Wrapper) *ReadingEventInit
ReadingEventInitFromJS is allocating a new ReadingEventInit object and copy all values from input javascript object
func (*ReadingEventInit) JSValue ¶
func (_this *ReadingEventInit) JSValue() js.Value
JSValue is allocating a new javasript object and copy all values
type Union ¶
func UnionFromJS ¶
type Writer ¶
class: NFCWriter
func NewNFCWriter ¶
func NewNFCWriter() (_result *Writer)
func WriterFromJS ¶
WriterFromJS is casting a js.Wrapper into Writer.
func (*Writer) Push ¶
func (_this *Writer) Push(message *Union, options *PushOptions) (_result *javascript.PromiseVoid)