mock

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestMethod     = "mock.MockService.Test"
	GetValueMethod = "mock.MockService.GetValue"
	Stream         = "mock.MockService.Stream"
)

TestMethod and GetValueMethod are the methods supported by the mock package.

Variables

This section is empty.

Functions

func GetVal

func GetVal(msg proto.Message) string

func RegisterServices

func RegisterServices(services []Service) error

RegisterServices registers the given services in the global registry. It is safe to call multiple times, but services with the same package name must be registered in the same call or be identical to previous registrations. Returns an error if registration fails.

func SetVal

func SetVal(msg proto.Message, val string)

Types

type Method

type Method struct {
	Name   string
	Input  proto.Message
	Output proto.Message
}

Method represents a method in a service.

type Service

type Service struct {
	Name    string // Full package and service name, e.g., "mock.MockService"
	Methods []Method
}

Service represents a service to be registered.

Jump to

Keyboard shortcuts

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