summationapi

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package summationapi defines a simple number summing service API for demonstration purposes.

Index

Constants

This section is empty.

Variables

View Source
var API = resource.APINamespace("acme").WithServiceType("summation")

API is the full API definition.

Functions

func Named

func Named(name string) resource.Name

Named is a helper for getting the named Summation's typed resource name.

func NewRPCServiceServer added in v0.2.36

func NewRPCServiceServer(coll resource.APIResourceCollection[Summation]) interface{}

NewRPCServiceServer returns a new RPC server for the summation API.

Types

type Summation

type Summation interface {
	resource.Resource
	Sum(ctx context.Context, nums []float64) (float64, error)
}

Summation defines the Go interface for the service (should match the protobuf methods.)

func FromRobot

func FromRobot(r robot.Robot, name string) (Summation, error)

FromRobot is a helper for getting the named Summation from the given Robot.

Jump to

Keyboard shortcuts

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