rpc

package
v0.2.26 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: LGPL-2.1 Imports: 13 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Name      = self.Name
	Using     = self.Using
	Install   = self.Install
	Uninstall = self.Uninstall
)
View Source
var (
	ErrMethodResultCountMismatch = errors.New("rpc: method result count mismatch")
	ErrMethodResultTypeMismatch  = errors.New("rpc: method result type mismatch")
)
View Source
var With _Option

Functions

func Assert1 added in v0.1.89

func Assert1[T1 any](ret async.Ret) T1

func Assert10 added in v0.1.89

func Assert10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 any](ret async.Ret) (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

func Assert11 added in v0.1.89

func Assert11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11 any](ret async.Ret) (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)

func Assert12 added in v0.1.89

func Assert12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12 any](ret async.Ret) (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)

func Assert13 added in v0.1.89

func Assert13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13 any](ret async.Ret) (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)

func Assert14 added in v0.1.89

func Assert14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14 any](ret async.Ret) (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)

func Assert15 added in v0.1.89

func Assert15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15 any](ret async.Ret) (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)

func Assert16 added in v0.1.89

func Assert16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16 any](ret async.Ret) (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)

func Assert2 added in v0.1.89

func Assert2[T1, T2 any](ret async.Ret) (T1, T2)

func Assert3 added in v0.1.89

func Assert3[T1, T2, T3 any](ret async.Ret) (T1, T2, T3)

func Assert4 added in v0.1.89

func Assert4[T1, T2, T3, T4 any](ret async.Ret) (T1, T2, T3, T4)

func Assert5 added in v0.1.89

func Assert5[T1, T2, T3, T4, T5 any](ret async.Ret) (T1, T2, T3, T4, T5)

func Assert6 added in v0.1.89

func Assert6[T1, T2, T3, T4, T5, T6 any](ret async.Ret) (T1, T2, T3, T4, T5, T6)

func Assert7 added in v0.1.89

func Assert7[T1, T2, T3, T4, T5, T6, T7 any](ret async.Ret) (T1, T2, T3, T4, T5, T6, T7)

func Assert8 added in v0.1.89

func Assert8[T1, T2, T3, T4, T5, T6, T7, T8 any](ret async.Ret) (T1, T2, T3, T4, T5, T6, T7, T8)

func Assert9 added in v0.1.89

func Assert9[T1, T2, T3, T4, T5, T6, T7, T8, T9 any](ret async.Ret) (T1, T2, T3, T4, T5, T6, T7, T8, T9)

func AssertRet2 added in v0.1.89

func AssertRet2[T1, T2 any](ret async.Ret) (T1, T2)

func AssertVoid added in v0.1.89

func AssertVoid(ret async.Ret)

func Asserts added in v0.1.89

func Asserts(ret async.Ret) []any

Types

type IRPC

type IRPC interface {
	// RPC RPC调用
	RPC(dst string, callChain rpcstack.CallChain, path string, args ...any) async.AsyncRet
	// OneWayRPC 单向RPC调用
	OneWayRPC(dst string, callChain rpcstack.CallChain, path string, args ...any) error
}

IRPC RPC支持

type RPCOptions

type RPCOptions struct {
	Processors []any
}

type ResultTuple0 added in v0.1.89

type ResultTuple0 struct {
	Error error
}

func ResultVoid

func ResultVoid(ret async.Ret) (rtp ResultTuple0)

func (ResultTuple0) Ensure added in v0.1.89

func (rtp ResultTuple0) Ensure()

func (ResultTuple0) Extract added in v0.1.89

func (rtp ResultTuple0) Extract() error

type ResultTuple1 added in v0.1.89

type ResultTuple1[T1 any] struct {
	R1    T1
	Error error
}

func Result1

func Result1[T1 any](ret async.Ret) (rtp ResultTuple1[T1])

func (ResultTuple1[T1]) Ensure added in v0.1.89

func (rtp ResultTuple1[T1]) Ensure() T1

func (ResultTuple1[T1]) Extract added in v0.1.89

func (rtp ResultTuple1[T1]) Extract() (T1, error)

type ResultTuple10 added in v0.1.89

type ResultTuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 any] struct {
	R1    T1
	R2    T2
	R3    T3
	R4    T4
	R5    T5
	R6    T6
	R7    T7
	R8    T8
	R9    T9
	R10   T10
	Error error
}

func Result10

func Result10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 any](ret async.Ret) (rtp ResultTuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10])

func (ResultTuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]) Ensure added in v0.1.89

func (rtp ResultTuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]) Ensure() (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

func (ResultTuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]) Extract added in v0.1.89

func (rtp ResultTuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]) Extract() (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, error)

type ResultTuple11 added in v0.1.89

type ResultTuple11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11 any] struct {
	R1    T1
	R2    T2
	R3    T3
	R4    T4
	R5    T5
	R6    T6
	R7    T7
	R8    T8
	R9    T9
	R10   T10
	R11   T11
	Error error
}

func Result11

func Result11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11 any](ret async.Ret) (rtp ResultTuple11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11])

func (ResultTuple11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11]) Ensure added in v0.1.89

func (rtp ResultTuple11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11]) Ensure() (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)

func (ResultTuple11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11]) Extract added in v0.1.89

func (rtp ResultTuple11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11]) Extract() (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, error)

type ResultTuple12 added in v0.1.89

type ResultTuple12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12 any] struct {
	R1    T1
	R2    T2
	R3    T3
	R4    T4
	R5    T5
	R6    T6
	R7    T7
	R8    T8
	R9    T9
	R10   T10
	R11   T11
	R12   T12
	Error error
}

func Result12

func Result12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12 any](ret async.Ret) (rtp ResultTuple12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12])

func (ResultTuple12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12]) Ensure added in v0.1.89

func (rtp ResultTuple12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12]) Ensure() (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)

func (ResultTuple12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12]) Extract added in v0.1.89

func (rtp ResultTuple12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12]) Extract() (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, error)

type ResultTuple13 added in v0.1.89

type ResultTuple13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13 any] struct {
	R1    T1
	R2    T2
	R3    T3
	R4    T4
	R5    T5
	R6    T6
	R7    T7
	R8    T8
	R9    T9
	R10   T10
	R11   T11
	R12   T12
	R13   T13
	Error error
}

func Result13

func Result13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13 any](ret async.Ret) (rtp ResultTuple13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13])

func (ResultTuple13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13]) Ensure added in v0.1.89

func (rtp ResultTuple13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13]) Ensure() (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)

func (ResultTuple13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13]) Extract added in v0.1.89

func (rtp ResultTuple13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13]) Extract() (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, error)

type ResultTuple14 added in v0.1.89

type ResultTuple14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14 any] struct {
	R1    T1
	R2    T2
	R3    T3
	R4    T4
	R5    T5
	R6    T6
	R7    T7
	R8    T8
	R9    T9
	R10   T10
	R11   T11
	R12   T12
	R13   T13
	R14   T14
	Error error
}

func Result14

func Result14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14 any](ret async.Ret) (rtp ResultTuple14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14])

func (ResultTuple14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14]) Ensure added in v0.1.89

func (rtp ResultTuple14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14]) Ensure() (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)

func (ResultTuple14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14]) Extract added in v0.1.89

func (rtp ResultTuple14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14]) Extract() (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, error)

type ResultTuple15 added in v0.1.89

type ResultTuple15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15 any] struct {
	R1    T1
	R2    T2
	R3    T3
	R4    T4
	R5    T5
	R6    T6
	R7    T7
	R8    T8
	R9    T9
	R10   T10
	R11   T11
	R12   T12
	R13   T13
	R14   T14
	R15   T15
	Error error
}

func Result15

func Result15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15 any](ret async.Ret) (rtp ResultTuple15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15])

func (ResultTuple15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15]) Ensure added in v0.1.89

func (rtp ResultTuple15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15]) Ensure() (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)

func (ResultTuple15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15]) Extract added in v0.1.89

func (rtp ResultTuple15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15]) Extract() (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, error)

type ResultTuple16 added in v0.1.89

type ResultTuple16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16 any] struct {
	R1    T1
	R2    T2
	R3    T3
	R4    T4
	R5    T5
	R6    T6
	R7    T7
	R8    T8
	R9    T9
	R10   T10
	R11   T11
	R12   T12
	R13   T13
	R14   T14
	R15   T15
	R16   T16
	Error error
}

func Result16

func Result16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16 any](ret async.Ret) (rtp ResultTuple16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16])

func (ResultTuple16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16]) Ensure added in v0.1.89

func (rtp ResultTuple16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16]) Ensure() (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)

func (ResultTuple16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16]) Extract added in v0.1.89

func (rtp ResultTuple16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16]) Extract() (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, error)

type ResultTuple2 added in v0.1.89

type ResultTuple2[T1, T2 any] struct {
	R1    T1
	R2    T2
	Error error
}

func Result2

func Result2[T1, T2 any](ret async.Ret) (rtp ResultTuple2[T1, T2])

func (ResultTuple2[T1, T2]) Ensure added in v0.1.89

func (rtp ResultTuple2[T1, T2]) Ensure() (T1, T2)

func (ResultTuple2[T1, T2]) Extract added in v0.1.89

func (rtp ResultTuple2[T1, T2]) Extract() (T1, T2, error)

type ResultTuple3 added in v0.1.89

type ResultTuple3[T1, T2, T3 any] struct {
	R1    T1
	R2    T2
	R3    T3
	Error error
}

func Result3

func Result3[T1, T2, T3 any](ret async.Ret) (rtp ResultTuple3[T1, T2, T3])

func (ResultTuple3[T1, T2, T3]) Ensure added in v0.1.89

func (rtp ResultTuple3[T1, T2, T3]) Ensure() (T1, T2, T3)

func (ResultTuple3[T1, T2, T3]) Extract added in v0.1.89

func (rtp ResultTuple3[T1, T2, T3]) Extract() (T1, T2, T3, error)

type ResultTuple4 added in v0.1.89

type ResultTuple4[T1, T2, T3, T4 any] struct {
	R1    T1
	R2    T2
	R3    T3
	R4    T4
	Error error
}

func Result4

func Result4[T1, T2, T3, T4 any](ret async.Ret) (rtp ResultTuple4[T1, T2, T3, T4])

func (ResultTuple4[T1, T2, T3, T4]) Ensure added in v0.1.89

func (rtp ResultTuple4[T1, T2, T3, T4]) Ensure() (T1, T2, T3, T4)

func (ResultTuple4[T1, T2, T3, T4]) Extract added in v0.1.89

func (rtp ResultTuple4[T1, T2, T3, T4]) Extract() (T1, T2, T3, T4, error)

type ResultTuple5 added in v0.1.89

type ResultTuple5[T1, T2, T3, T4, T5 any] struct {
	R1    T1
	R2    T2
	R3    T3
	R4    T4
	R5    T5
	Error error
}

func Result5

func Result5[T1, T2, T3, T4, T5 any](ret async.Ret) (rtp ResultTuple5[T1, T2, T3, T4, T5])

func (ResultTuple5[T1, T2, T3, T4, T5]) Ensure added in v0.1.89

func (rtp ResultTuple5[T1, T2, T3, T4, T5]) Ensure() (T1, T2, T3, T4, T5)

func (ResultTuple5[T1, T2, T3, T4, T5]) Extract added in v0.1.89

func (rtp ResultTuple5[T1, T2, T3, T4, T5]) Extract() (T1, T2, T3, T4, T5, error)

type ResultTuple6 added in v0.1.89

type ResultTuple6[T1, T2, T3, T4, T5, T6 any] struct {
	R1    T1
	R2    T2
	R3    T3
	R4    T4
	R5    T5
	R6    T6
	Error error
}

func Result6

func Result6[T1, T2, T3, T4, T5, T6 any](ret async.Ret) (rtp ResultTuple6[T1, T2, T3, T4, T5, T6])

func (ResultTuple6[T1, T2, T3, T4, T5, T6]) Ensure added in v0.1.89

func (rtp ResultTuple6[T1, T2, T3, T4, T5, T6]) Ensure() (T1, T2, T3, T4, T5, T6)

func (ResultTuple6[T1, T2, T3, T4, T5, T6]) Extract added in v0.1.89

func (rtp ResultTuple6[T1, T2, T3, T4, T5, T6]) Extract() (T1, T2, T3, T4, T5, T6, error)

type ResultTuple7 added in v0.1.89

type ResultTuple7[T1, T2, T3, T4, T5, T6, T7 any] struct {
	R1    T1
	R2    T2
	R3    T3
	R4    T4
	R5    T5
	R6    T6
	R7    T7
	Error error
}

func Result7

func Result7[T1, T2, T3, T4, T5, T6, T7 any](ret async.Ret) (rtp ResultTuple7[T1, T2, T3, T4, T5, T6, T7])

func (ResultTuple7[T1, T2, T3, T4, T5, T6, T7]) Ensure added in v0.1.89

func (rtp ResultTuple7[T1, T2, T3, T4, T5, T6, T7]) Ensure() (T1, T2, T3, T4, T5, T6, T7)

func (ResultTuple7[T1, T2, T3, T4, T5, T6, T7]) Extract added in v0.1.89

func (rtp ResultTuple7[T1, T2, T3, T4, T5, T6, T7]) Extract() (T1, T2, T3, T4, T5, T6, T7, error)

type ResultTuple8 added in v0.1.89

type ResultTuple8[T1, T2, T3, T4, T5, T6, T7, T8 any] struct {
	R1    T1
	R2    T2
	R3    T3
	R4    T4
	R5    T5
	R6    T6
	R7    T7
	R8    T8
	Error error
}

func Result8

func Result8[T1, T2, T3, T4, T5, T6, T7, T8 any](ret async.Ret) (rtp ResultTuple8[T1, T2, T3, T4, T5, T6, T7, T8])

func (ResultTuple8[T1, T2, T3, T4, T5, T6, T7, T8]) Ensure added in v0.1.89

func (rtp ResultTuple8[T1, T2, T3, T4, T5, T6, T7, T8]) Ensure() (T1, T2, T3, T4, T5, T6, T7, T8)

func (ResultTuple8[T1, T2, T3, T4, T5, T6, T7, T8]) Extract added in v0.1.89

func (rtp ResultTuple8[T1, T2, T3, T4, T5, T6, T7, T8]) Extract() (T1, T2, T3, T4, T5, T6, T7, T8, error)

type ResultTuple9 added in v0.1.89

type ResultTuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9 any] struct {
	R1    T1
	R2    T2
	R3    T3
	R4    T4
	R5    T5
	R6    T6
	R7    T7
	R8    T8
	R9    T9
	Error error
}

func Result9

func Result9[T1, T2, T3, T4, T5, T6, T7, T8, T9 any](ret async.Ret) (rtp ResultTuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9])

func (ResultTuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]) Ensure added in v0.1.89

func (rtp ResultTuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]) Ensure() (T1, T2, T3, T4, T5, T6, T7, T8, T9)

func (ResultTuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]) Extract added in v0.1.89

func (rtp ResultTuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]) Extract() (T1, T2, T3, T4, T5, T6, T7, T8, T9, error)

type ResultValues added in v0.1.89

type ResultValues struct {
	Values []any
	Error  error
}

func Results

func Results(ret async.Ret) (rvs ResultValues)

func (ResultValues) Ensure added in v0.1.89

func (rvs ResultValues) Ensure() []any

func (ResultValues) Extract added in v0.1.89

func (rvs ResultValues) Extract() ([]any, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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