facebookfriends

package
v0.0.0-...-17fbf12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EndpointNameCreate  = "create"
	EndpointNameDelete  = "delete"
	EndpointNameMutuals = "mutuals"
	EndpointNameOne     = "one"
)
View Source
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

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

Create creates a relationship between two facebook account. This function is idempotent

func (*FacebookFriendsClient) Delete

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

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL