rpc

package
v0.2.82 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: LGPL-2.1 Imports: 16 Imported by: 2

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

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

func Assert10

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

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

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

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

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

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

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

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

func Assert3

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

func Assert4

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

func Assert5

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

func Assert6

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

func Assert7

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

func Assert8

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

func Assert9

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 AssertVoid

func AssertVoid(ret async.Ret)

func Asserts

func Asserts(ret async.Ret) []any

Types

type IRPC

type IRPC interface {
	// RPC RPC调用
	RPC(dst string, cc rpcstack.CallChain, cp callpath.CallPath, args ...any) async.AsyncRet
	// OnewayRPC 单向RPC调用
	OnewayRPC(dst string, cc rpcstack.CallChain, cp callpath.CallPath, args ...any) error
}

IRPC RPC支持

type RPCOptions

type RPCOptions struct {
	Processors []any
}

type ResultTuple0

type ResultTuple0 struct {
	Error error
}

func ResultVoid

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

func (ResultTuple0) Ensure

func (rtp ResultTuple0) Ensure()

func (ResultTuple0) Extract

func (rtp ResultTuple0) Extract() error

type ResultTuple1

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

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

func (ResultTuple1[T1]) Extract

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

type ResultTuple10

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

func (ResultTuple2[T1, T2]) Extract

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

type ResultTuple3

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

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

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

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

type ResultTuple4

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

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

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

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

type ResultTuple5

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

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

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

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

type ResultTuple6

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

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

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

type ResultTuple7

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

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

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

type ResultTuple8

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

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

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

type ResultTuple9

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

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

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

type ResultValues struct {
	Values []any
	Error  error
}

func Results

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

func (ResultValues) Ensure

func (rvs ResultValues) Ensure() []any

func (ResultValues) Extract

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