xpc

package
v0.0.0-...-ed0e5b9 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2015 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultService = NewService()

DefaultServer is the default instance of *Server.

Functions

func CallHost

func CallHost(name string, args []interface{})

func ReceivedErrorEvent

func ReceivedErrorEvent(err *C.char)

func ReceivedPayload

func ReceivedPayload(payload unsafe.Pointer, length C.int)

func Register

func Register(rcvr interface{}) error

Register publishes the receiver's methods in the DefaultServer.

func Start

func Start()

Types

type Payload

type Payload struct {
	Method string        `codec:"method"`
	Args   []interface{} `codec:"args"`
}

type XPCService

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

func NewService

func NewService() *XPCService

NewService returns a new XPCService.

func (*XPCService) CallHost

func (xpc *XPCService) CallHost(name string, args []interface{})

func (*XPCService) Register

func (xpc *XPCService) Register(rcvr interface{}) error

Register publishes in the server the set of methods of the receiver value that satisfy the following conditions:

  • exported method
  • two arguments, both of exported type
  • the second argument is a pointer
  • one return value, of type error

It returns an error if the receiver is not an exported type or has no suitable methods. It also logs the error using package log. The client accesses each method using a string of the form "Type.Method", where Type is the receiver's concrete type.

func (*XPCService) Start

func (xpc *XPCService) Start()

Jump to

Keyboard shortcuts

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