當前位置: 首頁>>代碼示例>>Golang>>正文


Golang capnproto2.NewCallOptions函數代碼示例

本文整理匯總了Golang中zombiezen/com/go/capnproto2.NewCallOptions函數的典型用法代碼示例。如果您正苦於以下問題:Golang NewCallOptions函數的具體用法?Golang NewCallOptions怎麽用?Golang NewCallOptions使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了NewCallOptions函數的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: GetCallSequence

func (c Echoer) GetCallSequence(ctx context.Context, params func(CallOrder_getCallSequence_Params) error, opts ...capnp.CallOption) CallOrder_getCallSequence_Results_Promise {
	if c.Client == nil {
		return CallOrder_getCallSequence_Results_Promise{Pipeline: capnp.NewPipeline(capnp.ErrorAnswer(capnp.ErrNullClient))}
	}
	return CallOrder_getCallSequence_Results_Promise{Pipeline: capnp.NewPipeline(c.Client.Call(&capnp.Call{
		Ctx: ctx,
		Method: capnp.Method{

			InterfaceID:   0x92c5ca8314cdd2a5,
			MethodID:      0,
			InterfaceName: "test.capnp:CallOrder",
			MethodName:    "getCallSequence",
		},
		ParamsSize: capnp.ObjectSize{DataSize: 8, PointerCount: 0},
		ParamsFunc: func(s capnp.Struct) error { return params(CallOrder_getCallSequence_Params{Struct: s}) },
		Options:    capnp.NewCallOptions(opts),
	}))}
}
開發者ID:hodduc,項目名稱:go-capnproto2,代碼行數:18,代碼來源:test.capnp.go

示例2: Add

func (c Adder) Add(ctx context.Context, params func(Adder_add_Params) error, opts ...capnp.CallOption) Adder_add_Results_Promise {
	if c.Client == nil {
		return Adder_add_Results_Promise{Pipeline: capnp.NewPipeline(capnp.ErrorAnswer(capnp.ErrNullClient))}
	}
	return Adder_add_Results_Promise{Pipeline: capnp.NewPipeline(c.Client.Call(&capnp.Call{
		Ctx: ctx,
		Method: capnp.Method{

			InterfaceID:   0x8f9cac550b1bf41f,
			MethodID:      0,
			InterfaceName: "test.capnp:Adder",
			MethodName:    "add",
		},
		ParamsSize: capnp.ObjectSize{DataSize: 8, PointerCount: 0},
		ParamsFunc: func(s capnp.Struct) error { return params(Adder_add_Params{Struct: s}) },
		Options:    capnp.NewCallOptions(opts),
	}))}
}
開發者ID:hodduc,項目名稱:go-capnproto2,代碼行數:18,代碼來源:test.capnp.go

示例3: NewHandle

func (c HandleFactory) NewHandle(ctx context.Context, params func(HandleFactory_newHandle_Params) error, opts ...capnp.CallOption) HandleFactory_newHandle_Results_Promise {
	if c.Client == nil {
		return HandleFactory_newHandle_Results_Promise{Pipeline: capnp.NewPipeline(capnp.ErrorAnswer(capnp.ErrNullClient))}
	}
	return HandleFactory_newHandle_Results_Promise{Pipeline: capnp.NewPipeline(c.Client.Call(&capnp.Call{
		Ctx: ctx,
		Method: capnp.Method{

			InterfaceID:   0x8491a7fe75fe0bce,
			MethodID:      0,
			InterfaceName: "test.capnp:HandleFactory",
			MethodName:    "newHandle",
		},
		ParamsSize: capnp.ObjectSize{DataSize: 0, PointerCount: 0},
		ParamsFunc: func(s capnp.Struct) error { return params(HandleFactory_newHandle_Params{Struct: s}) },
		Options:    capnp.NewCallOptions(opts),
	}))}
}
開發者ID:hodduc,項目名稱:go-capnproto2,代碼行數:18,代碼來源:test.capnp.go

示例4: Echo

func (c Echoer) Echo(ctx context.Context, params func(Echoer_echo_Params) error, opts ...capnp.CallOption) Echoer_echo_Results_Promise {
	if c.Client == nil {
		return Echoer_echo_Results_Promise{Pipeline: capnp.NewPipeline(capnp.ErrorAnswer(capnp.ErrNullClient))}
	}
	return Echoer_echo_Results_Promise{Pipeline: capnp.NewPipeline(c.Client.Call(&capnp.Call{
		Ctx: ctx,
		Method: capnp.Method{

			InterfaceID:   0x841756c6a41b2a45,
			MethodID:      0,
			InterfaceName: "test.capnp:Echoer",
			MethodName:    "echo",
		},
		ParamsSize: capnp.ObjectSize{DataSize: 0, PointerCount: 1},
		ParamsFunc: func(s capnp.Struct) error { return params(Echoer_echo_Params{Struct: s}) },
		Options:    capnp.NewCallOptions(opts),
	}))}
}
開發者ID:hodduc,項目名稱:go-capnproto2,代碼行數:18,代碼來源:test.capnp.go

示例5: Sum

func (c Hash) Sum(ctx context.Context, params func(Hash_sum_Params) error, opts ...capnp.CallOption) Hash_sum_Results_Promise {
	if c.Client == nil {
		return Hash_sum_Results_Promise{Pipeline: capnp.NewPipeline(capnp.ErrorAnswer(capnp.ErrNullClient))}
	}
	return Hash_sum_Results_Promise{Pipeline: capnp.NewPipeline(c.Client.Call(&capnp.Call{
		Ctx: ctx,
		Method: capnp.Method{

			InterfaceID:   0xf29f97dd675a9431,
			MethodID:      1,
			InterfaceName: "hash.capnp:Hash",
			MethodName:    "sum",
		},
		ParamsSize: capnp.ObjectSize{DataSize: 0, PointerCount: 0},
		ParamsFunc: func(s capnp.Struct) error { return params(Hash_sum_Params{Struct: s}) },
		Options:    capnp.NewCallOptions(opts),
	}))}
}
開發者ID:hodduc,項目名稱:go-capnproto2,代碼行數:18,代碼來源:hash.capnp.go

示例6: Hang

func (c Hanger) Hang(ctx context.Context, params func(Hanger_hang_Params) error, opts ...capnp.CallOption) Hanger_hang_Results_Promise {
	if c.Client == nil {
		return Hanger_hang_Results_Promise{Pipeline: capnp.NewPipeline(capnp.ErrorAnswer(capnp.ErrNullClient))}
	}
	return Hanger_hang_Results_Promise{Pipeline: capnp.NewPipeline(c.Client.Call(&capnp.Call{
		Ctx: ctx,
		Method: capnp.Method{

			InterfaceID:   0x8ae08044aae8a26e,
			MethodID:      0,
			InterfaceName: "test.capnp:Hanger",
			MethodName:    "hang",
		},
		ParamsSize: capnp.ObjectSize{DataSize: 0, PointerCount: 0},
		ParamsFunc: func(s capnp.Struct) error { return params(Hanger_hang_Params{Struct: s}) },
		Options:    capnp.NewCallOptions(opts),
	}))}
}
開發者ID:hodduc,項目名稱:go-capnproto2,代碼行數:18,代碼來源:test.capnp.go

示例7: NewSha1

func (c HashFactory) NewSha1(ctx context.Context, params func(HashFactory_newSha1_Params) error, opts ...capnp.CallOption) HashFactory_newSha1_Results_Promise {
	if c.Client == nil {
		return HashFactory_newSha1_Results_Promise{Pipeline: capnp.NewPipeline(capnp.ErrorAnswer(capnp.ErrNullClient))}
	}
	return HashFactory_newSha1_Results_Promise{Pipeline: capnp.NewPipeline(c.Client.Call(&capnp.Call{
		Ctx: ctx,
		Method: capnp.Method{

			InterfaceID:   0xaead580f97fddabc,
			MethodID:      0,
			InterfaceName: "hash.capnp:HashFactory",
			MethodName:    "newSha1",
		},
		ParamsSize: capnp.ObjectSize{DataSize: 0, PointerCount: 0},
		ParamsFunc: func(s capnp.Struct) error { return params(HashFactory_newSha1_Params{Struct: s}) },
		Options:    capnp.NewCallOptions(opts),
	}))}
}
開發者ID:hodduc,項目名稱:go-capnproto2,代碼行數:18,代碼來源:hash.capnp.go

示例8: EchoNum

func (c PingPong) EchoNum(ctx context.Context, params func(PingPong_echoNum_Params) error, opts ...capnp.CallOption) PingPong_echoNum_Results_Promise {
	if c.Client == nil {
		return PingPong_echoNum_Results_Promise{Pipeline: capnp.NewPipeline(capnp.ErrorAnswer(capnp.ErrNullClient))}
	}
	call := &capnp.Call{
		Ctx: ctx,
		Method: capnp.Method{
			InterfaceID:   0xf004c474c2f8ee7a,
			MethodID:      0,
			InterfaceName: "test.capnp:PingPong",
			MethodName:    "echoNum",
		},
		Options: capnp.NewCallOptions(opts),
	}
	if params != nil {
		call.ParamsSize = capnp.ObjectSize{DataSize: 8, PointerCount: 0}
		call.ParamsFunc = func(s capnp.Struct) error { return params(PingPong_echoNum_Params{Struct: s}) }
	}
	return PingPong_echoNum_Results_Promise{Pipeline: capnp.NewPipeline(c.Client.Call(call))}
}
開發者ID:zombiezen,項目名稱:go-capnproto2,代碼行數:20,代碼來源:test.capnp.go

示例9: Write

func (c Hash) Write(ctx context.Context, params func(Hash_write_Params) error, opts ...capnp.CallOption) Hash_write_Results_Promise {
	if c.Client == nil {
		return Hash_write_Results_Promise{Pipeline: capnp.NewPipeline(capnp.ErrorAnswer(capnp.ErrNullClient))}
	}
	call := &capnp.Call{
		Ctx: ctx,
		Method: capnp.Method{
			InterfaceID:   0xf29f97dd675a9431,
			MethodID:      0,
			InterfaceName: "hash.capnp:Hash",
			MethodName:    "write",
		},
		Options: capnp.NewCallOptions(opts),
	}
	if params != nil {
		call.ParamsSize = capnp.ObjectSize{DataSize: 0, PointerCount: 1}
		call.ParamsFunc = func(s capnp.Struct) error { return params(Hash_write_Params{Struct: s}) }
	}
	return Hash_write_Results_Promise{Pipeline: capnp.NewPipeline(c.Client.Call(call))}
}
開發者ID:zombiezen,項目名稱:go-capnproto2,代碼行數:20,代碼來源:hash.capnp.go

示例10: Export

func (c RealmGateway) Export(ctx context.Context, params func(RealmGateway_export_Params) error, opts ...capnp.CallOption) Persistent_SaveResults_Promise {
	if c.Client == nil {
		return Persistent_SaveResults_Promise{Pipeline: capnp.NewPipeline(capnp.ErrorAnswer(capnp.ErrNullClient))}
	}
	call := &capnp.Call{
		Ctx: ctx,
		Method: capnp.Method{
			InterfaceID:   0x84ff286cd00a3ed4,
			MethodID:      1,
			InterfaceName: "persistent.capnp:RealmGateway",
			MethodName:    "export",
		},
		Options: capnp.NewCallOptions(opts),
	}
	if params != nil {
		call.ParamsSize = capnp.ObjectSize{DataSize: 0, PointerCount: 2}
		call.ParamsFunc = func(s capnp.Struct) error { return params(RealmGateway_export_Params{Struct: s}) }
	}
	return Persistent_SaveResults_Promise{Pipeline: capnp.NewPipeline(c.Client.Call(call))}
}
開發者ID:zombiezen,項目名稱:go-capnproto2,代碼行數:20,代碼來源:persistent.capnp.go

示例11: Save

func (c Persistent) Save(ctx context.Context, params func(Persistent_SaveParams) error, opts ...capnp.CallOption) Persistent_SaveResults_Promise {
	if c.Client == nil {
		return Persistent_SaveResults_Promise{Pipeline: capnp.NewPipeline(capnp.ErrorAnswer(capnp.ErrNullClient))}
	}
	call := &capnp.Call{
		Ctx: ctx,
		Method: capnp.Method{
			InterfaceID:   0xc8cb212fcd9f5691,
			MethodID:      0,
			InterfaceName: "persistent.capnp:Persistent",
			MethodName:    "save",
		},
		Options: capnp.NewCallOptions(opts),
	}
	if params != nil {
		call.ParamsSize = capnp.ObjectSize{DataSize: 0, PointerCount: 1}
		call.ParamsFunc = func(s capnp.Struct) error { return params(Persistent_SaveParams{Struct: s}) }
	}
	return Persistent_SaveResults_Promise{Pipeline: capnp.NewPipeline(c.Client.Call(call))}
}
開發者ID:zombiezen,項目名稱:go-capnproto2,代碼行數:20,代碼來源:persistent.capnp.go

示例12: TakeTurn

func (c Ai) TakeTurn(ctx context.Context, params func(Ai_takeTurn_Params) error, opts ...capnp.CallOption) Ai_takeTurn_Results_Promise {
	if c.Client == nil {
		return Ai_takeTurn_Results_Promise{Pipeline: capnp.NewPipeline(capnp.ErrorAnswer(capnp.ErrNullClient))}
	}
	call := &capnp.Call{
		Ctx: ctx,
		Method: capnp.Method{
			InterfaceID:   0xd403ce7bb5b69f1f,
			MethodID:      0,
			InterfaceName: "botapi.capnp:Ai",
			MethodName:    "takeTurn",
		},
		Options: capnp.NewCallOptions(opts),
	}
	if params != nil {
		call.ParamsSize = capnp.ObjectSize{DataSize: 0, PointerCount: 1}
		call.ParamsFunc = func(s capnp.Struct) error { return params(Ai_takeTurn_Params{Struct: s}) }
	}
	return Ai_takeTurn_Results_Promise{Pipeline: capnp.NewPipeline(c.Client.Call(call))}
}
開發者ID:bcspragu,項目名稱:Gobots,代碼行數:20,代碼來源:botapi.capnp.go

示例13: Connect

func (c AiConnector) Connect(ctx context.Context, params func(ConnectRequest) error, opts ...capnp.CallOption) AiConnector_connect_Results_Promise {
	if c.Client == nil {
		return AiConnector_connect_Results_Promise{Pipeline: capnp.NewPipeline(capnp.ErrorAnswer(capnp.ErrNullClient))}
	}
	call := &capnp.Call{
		Ctx: ctx,
		Method: capnp.Method{
			InterfaceID:   0x9804b41cc3cba212,
			MethodID:      0,
			InterfaceName: "botapi.capnp:AiConnector",
			MethodName:    "connect",
		},
		Options: capnp.NewCallOptions(opts),
	}
	if params != nil {
		call.ParamsSize = capnp.ObjectSize{DataSize: 0, PointerCount: 2}
		call.ParamsFunc = func(s capnp.Struct) error { return params(ConnectRequest{Struct: s}) }
	}
	return AiConnector_connect_Results_Promise{Pipeline: capnp.NewPipeline(c.Client.Call(call))}
}
開發者ID:bcspragu,項目名稱:Gobots,代碼行數:20,代碼來源:botapi.capnp.go


注:本文中的zombiezen/com/go/capnproto2.NewCallOptions函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。