Documentation ¶
Index ¶
- Constants
- func NewCreateHandler(ctx context.Context, svc FacebookFriendsService, opts *kitworker.ServerOption, ...) (string, *httptransport.Server)
- func NewDeleteHandler(ctx context.Context, svc FacebookFriendsService, opts *kitworker.ServerOption, ...) (string, *httptransport.Server)
- func NewMutualsHandler(ctx context.Context, svc FacebookFriendsService, opts *kitworker.ServerOption, ...) (string, *httptransport.Server)
- func NewOneHandler(ctx context.Context, svc FacebookFriendsService, opts *kitworker.ServerOption, ...) (string, *httptransport.Server)
- func RegisterHandlers(ctx context.Context, svc FacebookFriendsService, ...)
- type FacebookFriendsClient
- func (f *FacebookFriendsClient) Create(ctx context.Context, req *models.FacebookFriends) (*models.FacebookFriends, error)
- func (f *FacebookFriendsClient) Delete(ctx context.Context, req *models.FacebookFriends) (*models.FacebookFriends, error)
- func (f *FacebookFriendsClient) Mutuals(ctx context.Context, req *[]*models.FacebookFriends) (*[]string, error)
- func (f *FacebookFriendsClient) One(ctx context.Context, req *models.FacebookFriends) (*models.FacebookFriends, error)
- type FacebookFriendsService
Constants ¶
const ( EndpointNameCreate = "create" EndpointNameDelete = "delete" EndpointNameMutuals = "mutuals" EndpointNameOne = "one" )
const ServiceName = "facebookfriends"
Variables ¶
This section is empty.
Functions ¶
func NewCreateHandler ¶
func NewCreateHandler(ctx context.Context, svc FacebookFriendsService, opts *kitworker.ServerOption, logger log.Logger) (string, *httptransport.Server)
Create creates a relationship between two facebook account. This function is idempotent
func NewDeleteHandler ¶
func NewDeleteHandler(ctx context.Context, svc FacebookFriendsService, opts *kitworker.ServerOption, logger log.Logger) (string, *httptransport.Server)
Delete removes friendship.
func NewMutualsHandler ¶
func NewMutualsHandler(ctx context.Context, svc FacebookFriendsService, opts *kitworker.ServerOption, logger log.Logger) (string, *httptransport.Server)
Mutuals return mutual friend's Facebook IDs between given source id and target id. Source and Target are inclusive.
func NewOneHandler ¶
func NewOneHandler(ctx context.Context, svc FacebookFriendsService, opts *kitworker.ServerOption, logger log.Logger) (string, *httptransport.Server)
One fetches a FacebookFriends from system with FacebookFriends, will be used for validating the existance of the friendship
func RegisterHandlers ¶
func RegisterHandlers(ctx context.Context, svc FacebookFriendsService, serverOpts *kitworker.ServerOption, logger log.Logger)
RegisterHandlers registers handlers of FacebookFriendsService to the http.DefaultServeMux
Types ¶
type FacebookFriendsClient ¶
type FacebookFriendsClient struct { // CreateLoadBalancer provides remote call to create endpoints CreateLoadBalancer lb.Balancer // DeleteLoadBalancer provides remote call to delete endpoints DeleteLoadBalancer lb.Balancer // MutualsLoadBalancer provides remote call to mutuals endpoints MutualsLoadBalancer lb.Balancer // OneLoadBalancer provides remote call to one endpoints OneLoadBalancer lb.Balancer }
FacebookFriendsClient holds remote endpoint functions Satisfies FacebookFriendsService interface
func NewFacebookFriendsClient ¶
func NewFacebookFriendsClient(clientOpts *kitworker.ClientOption, logger log.Logger) *FacebookFriendsClient
NewFacebookFriendsClient creates a new client for FacebookFriendsService
func (*FacebookFriendsClient) Create ¶
func (f *FacebookFriendsClient) Create(ctx context.Context, req *models.FacebookFriends) (*models.FacebookFriends, error)
Create creates a relationship between two facebook account. This function is idempotent
func (*FacebookFriendsClient) Delete ¶
func (f *FacebookFriendsClient) Delete(ctx context.Context, req *models.FacebookFriends) (*models.FacebookFriends, error)
Delete removes friendship.
func (*FacebookFriendsClient) Mutuals ¶
func (f *FacebookFriendsClient) Mutuals(ctx context.Context, req *[]*models.FacebookFriends) (*[]string, error)
Mutuals return mutual friend's Facebook IDs between given source id and target id. Source and Target are inclusive.
func (*FacebookFriendsClient) One ¶
func (f *FacebookFriendsClient) One(ctx context.Context, req *models.FacebookFriends) (*models.FacebookFriends, error)
One fetches a FacebookFriends from system with FacebookFriends, will be used for validating the existance of the friendship
type FacebookFriendsService ¶
type FacebookFriendsService interface { // Create creates a relationship between two facebook account. This function is // idempotent Create(ctx context.Context, req *models.FacebookFriends) (res *models.FacebookFriends, err error) // Delete removes friendship. Delete(ctx context.Context, req *models.FacebookFriends) (res *models.FacebookFriends, err error) // Mutuals return mutual friend's Facebook IDs between given source id and // target id. Source and Target are inclusive. Mutuals(ctx context.Context, req *[]*models.FacebookFriends) (res *[]string, err error) // One fetches a FacebookFriends from system with FacebookFriends, will be used // for validating the existance of the friendship One(ctx context.Context, req *models.FacebookFriends) (res *models.FacebookFriends, err error) }
Holds Facebook Friendship Status
func NewFacebookFriends ¶
func NewFacebookFriends() FacebookFriendsService