inprocess

package
v0.0.50-alpha.121 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const BroadcastPath = "/internal/api_invoke_rpc"

Variables

This section is empty.

Functions

func GetDiscoveryConn

func GetDiscoveryConn() discovery.Conn

func GetKeyValue

func GetKeyValue() discovery.KeyValue

func GetServiceRegistrar

func GetServiceRegistrar() grpc.ServiceRegistrar

func GetSvcDiscoveryRegistry

func GetSvcDiscoveryRegistry() discovery.SvcDiscoveryRegistry

func SetBroadcastAddress

func SetBroadcastAddress(secret string, fn BroadcastAddressProvider)

SetBroadcastAddress enables cross-instance calls: GetConns returns the local in-process connection plus one remote connection per address reported by fn. secret must equal the peers' share.secret, which their RpcInvoke endpoint checks.

func SetContextAdminFunc

func SetContextAdminFunc(fn func(ctx context.Context) bool)

func SetLocalTarget

func SetLocalTarget(addr string)

Types

type BroadcastAddressFunc

type BroadcastAddressFunc = BroadcastAddressProvider

BroadcastAddressFunc is kept as a source-compatible alias for older callers.

type BroadcastAddressProvider

type BroadcastAddressProvider func(ctx context.Context) ([]string, error)

BroadcastAddressProvider returns the http api addresses of the other in-process-mode instances, excluding this one; the local instance is always invoked in memory.

type InvokeRequest

type InvokeRequest struct {
	Service  string `json:"service"`
	Method   string `json:"method"`
	Secret   string `json:"secret"`
	OpUserID string `json:"op_user_id"`
	Admin    bool   `json:"admin"`
	Request  []byte `json:"request"`
}

InvokeRequest must match the request type of internalApi.RpcInvoke.

type InvokeResponse

type InvokeResponse struct {
	ErrCode int    `json:"errCode"`
	ErrMsg  string `json:"errMsg"`
	ErrDlt  string `json:"errDlt"`
	Data    []byte `json:"data"`
}

InvokeResponse is the apiresp.ApiResponse envelope with []byte data.

Jump to

Keyboard shortcuts

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