mirror of
https://github.com/iLoveElysia/openbilibili.git
synced 2026-06-07 21:48:31 -05:00
21 lines
445 B
Go
21 lines
445 B
Go
|
|
package api
|
||
|
|
|
||
|
|
import (
|
||
|
|
"context"
|
||
|
|
"fmt"
|
||
|
|
|
||
|
|
"go-common/library/net/rpc/warden"
|
||
|
|
|
||
|
|
"google.golang.org/grpc"
|
||
|
|
)
|
||
|
|
|
||
|
|
// AppID .
|
||
|
|
const AppID = "community.service.favorite"
|
||
|
|
|
||
|
|
// New fav service client
|
||
|
|
func New(c *warden.ClientConfig, opts ...grpc.DialOption) (FavoriteClient, error) {
|
||
|
|
client := warden.NewClient(c, opts...)
|
||
|
|
conn, err := client.Dial(context.Background(), fmt.Sprintf("discovery://default/%s", AppID))
|
||
|
|
return NewFavoriteClient(conn), err
|
||
|
|
}
|