32 lines
784 B
Go
32 lines
784 B
Go
package instance
|
|
|
|
import (
|
|
"codeup.aliyun.com/6552e56cc3b2728a4557fc18/plugin/manage"
|
|
"codeup.aliyun.com/6552e56cc3b2728a4557fc18/plugin/proto"
|
|
"context"
|
|
)
|
|
|
|
func Order(ctx context.Context, tag string, request *proto.OrderRequest) (*proto.OrderResponse, error) {
|
|
srv, err := manage.Get(tag)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return srv.Order(ctx, request)
|
|
}
|
|
|
|
func Query(ctx context.Context, tag string, request *proto.QueryRequest) (*proto.QueryResponse, error) {
|
|
srv, err := manage.Get(tag)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return srv.Query(ctx, request)
|
|
}
|
|
|
|
func Notify(ctx context.Context, tag string, request *proto.NotifyRequest) (*proto.NotifyResponse, error) {
|
|
srv, err := manage.Get(tag)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return srv.Notify(ctx, request)
|
|
}
|