plugin/instance/instance.go

32 lines
753 B
Go
Raw Normal View History

2024-08-30 18:02:15 +08:00
package instance
import (
"context"
2024-08-30 18:03:34 +08:00
"gitea.cdlsxd.cn/sdk/plugin/manage"
"gitea.cdlsxd.cn/sdk/plugin/proto"
2024-08-30 18:02:15 +08:00
)
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.Impl.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.Impl.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.Impl.Notify(ctx, request)
}