account

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 (
	EndpointNameByFacebookIDs = "byfacebookids"
	EndpointNameByIDs         = "byids"
	EndpointNameCreate        = "create"
	EndpointNameDelete        = "delete"
	EndpointNameOne           = "one"
	EndpointNameUpdate        = "update"
)
View Source
const ServiceName = "account"

Variables

This section is empty.

Functions

func NewByFacebookIDsHandler

func NewByFacebookIDsHandler(ctx context.Context, svc AccountService, opts *kitworker.ServerOption, logger log.Logger) (string, *httptransport.Server)

ByFacebookIDs fetches multiple Accounts from system by their FacebookIDs

func NewByIDsHandler

func NewByIDsHandler(ctx context.Context, svc AccountService, opts *kitworker.ServerOption, logger log.Logger) (string, *httptransport.Server)

ByIDs fetches multiple Accounts from system by their IDs

func NewCreateHandler

func NewCreateHandler(ctx context.Context, svc AccountService, opts *kitworker.ServerOption, logger log.Logger) (string, *httptransport.Server)

Create registers and account in the system by the given data

func NewDeleteHandler

func NewDeleteHandler(ctx context.Context, svc AccountService, opts *kitworker.ServerOption, logger log.Logger) (string, *httptransport.Server)

Delete deletes the account from the system with given account id. Deletes are soft.

func NewOneHandler

func NewOneHandler(ctx context.Context, svc AccountService, opts *kitworker.ServerOption, logger log.Logger) (string, *httptransport.Server)

One fetches an Account from system by its ID

func NewUpdateHandler

func NewUpdateHandler(ctx context.Context, svc AccountService, opts *kitworker.ServerOption, logger log.Logger) (string, *httptransport.Server)

Update updates the account on the system with given account data.

func RegisterHandlers

func RegisterHandlers(ctx context.Context, svc AccountService, serverOpts *kitworker.ServerOption, logger log.Logger)

RegisterHandlers registers handlers of AccountService to the http.DefaultServeMux

Types

type AccountClient

type AccountClient struct {
	// ByFacebookIDsLoadBalancer provides remote call to byfacebookids endpoints
	ByFacebookIDsLoadBalancer lb.Balancer

	// ByIDsLoadBalancer provides remote call to byids endpoints
	ByIDsLoadBalancer lb.Balancer

	// CreateLoadBalancer provides remote call to create endpoints
	CreateLoadBalancer lb.Balancer

	// DeleteLoadBalancer provides remote call to delete endpoints
	DeleteLoadBalancer lb.Balancer

	// OneLoadBalancer provides remote call to one endpoints
	OneLoadBalancer lb.Balancer

	// UpdateLoadBalancer provides remote call to update endpoints
	UpdateLoadBalancer lb.Balancer
}

AccountClient holds remote endpoint functions Satisfies AccountService interface

func NewAccountClient

func NewAccountClient(clientOpts *kitworker.ClientOption, logger log.Logger) *AccountClient

NewAccountClient creates a new client for AccountService

func (*AccountClient) ByFacebookIDs

func (a *AccountClient) ByFacebookIDs(ctx context.Context, req *[]string) (*[]*models.Account, error)

ByFacebookIDs fetches multiple Accounts from system by their FacebookIDs

func (*AccountClient) ByIDs

func (a *AccountClient) ByIDs(ctx context.Context, req *[]int64) (*[]*models.Account, error)

ByIDs fetches multiple Accounts from system by their IDs

func (*AccountClient) Create

func (a *AccountClient) Create(ctx context.Context, req *models.Account) (*models.Account, error)

Create registers and account in the system by the given data

func (*AccountClient) Delete

func (a *AccountClient) Delete(ctx context.Context, req *int64) (*models.Account, error)

Delete deletes the account from the system with given account id. Deletes are soft.

func (*AccountClient) One

func (a *AccountClient) One(ctx context.Context, req *int64) (*models.Account, error)

One fetches an Account from system by its ID

func (*AccountClient) Update

func (a *AccountClient) Update(ctx context.Context, req *models.Account) (*models.Account, error)

Update updates the account on the system with given account data.

type AccountService

type AccountService interface {
	// ByFacebookIDs fetches multiple Accounts from system by their FacebookIDs
	ByFacebookIDs(ctx context.Context, req *[]string) (res *[]*models.Account, err error)

	// ByIDs fetches multiple Accounts from system by their IDs
	ByIDs(ctx context.Context, req *[]int64) (res *[]*models.Account, err error)

	// Create registers and account in the system by the given data
	Create(ctx context.Context, req *models.Account) (res *models.Account, err error)

	// Delete deletes the account from the system with given account id. Deletes are
	// soft.
	Delete(ctx context.Context, req *int64) (res *models.Account, err error)

	// One fetches an Account from system by its ID
	One(ctx context.Context, req *int64) (res *models.Account, err error)

	// Update updates the account on the system with given account data.
	Update(ctx context.Context, req *models.Account) (res *models.Account, err error)
}

Account represents a registered User

func NewAccount

func NewAccount() AccountService

Jump to

Keyboard shortcuts

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