pong

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package pong contains the implementation of the PingPong service.

The file ping_stub_gen.go is generated with:

$ qiloop stub --idl ping.qi.idl --output ping_stub_gen.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PingPongObject

func PingPongObject(impl PingPongImplementor) bus.Actor

PingPongObject returns an object using PingPongImplementor

Types

type PingPongImplementor

type PingPongImplementor interface {
	// Activate is called before any other method.
	// It shall be used to initialize the interface.
	// activation provides runtime informations.
	// activation.Terminate() unregisters the object.
	// activation.Session can access other services.
	// helper enables signals and properties updates.
	// Properties must be initialized using helper,
	// during the Activate call.
	Activate(activation bus.Activation, helper PingPongSignalHelper) error
	OnTerminate()
	Hello(a string) (string, error)
	Ping(a string) error
}

PingPongImplementor interface of the service implementation

func PingPongImpl

func PingPongImpl() PingPongImplementor

PingPongImpl returns an implementation of ping pong.

type PingPongProxy

type PingPongProxy interface {
	Hello(a string) (string, error)
	Ping(a string) error
	SubscribePong() (unsubscribe func(), updates chan string, err error)
	// Generic methods shared by all objectsProxy
	bus.ObjectProxy
	// WithContext can be used cancellation and timeout
	WithContext(ctx context.Context) PingPongProxy
}

PingPongProxy represents a proxy object to the service

func CreatePingPong

func CreatePingPong(session bus.Session, service bus.Service, impl PingPongImplementor) (PingPongProxy, error)

CreatePingPong registers a new object to a service and returns a proxy to the newly created object

func MakePingPong

func MakePingPong(sess bus.Session, proxy bus.Proxy) PingPongProxy

MakePingPong returns a specialized proxy.

func PingPong

func PingPong(session bus.Session) (PingPongProxy, error)

PingPong returns a proxy to a remote service

type PingPongSignalHelper

type PingPongSignalHelper interface {
	SignalPong(a string) error
}

PingPongSignalHelper provided to PingPong a companion object

Directories

Path Synopsis
cmd
client
Package main illustrate how to interract with the PingPong service.
Package main illustrate how to interract with the PingPong service.
service
Package main illustrate how to use the pong package to create a service "PingPong" registered to the service directory.
Package main illustrate how to use the pong package to create a service "PingPong" registered to the service directory.

Jump to

Keyboard shortcuts

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