You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
348 B
17 lines
348 B
package services
|
|
|
|
import (
|
|
"github.com/cloudwego/kitex/client"
|
|
)
|
|
|
|
type Service[T any] struct {
|
|
Client T
|
|
}
|
|
|
|
func New[T any](name string, op func(destService string, opts ...client.Option) (T, error), options []client.Option) *Service[T] {
|
|
client, err := op(name, options...)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return &Service[T]{Client: client}
|
|
}
|
|
|