Documentation ¶
Index ¶
- Constants
- func NewByFacebookIDsHandler(ctx context.Context, svc AccountService, opts *kitworker.ServerOption, ...) (string, *httptransport.Server)
- func NewByIDsHandler(ctx context.Context, svc AccountService, opts *kitworker.ServerOption, ...) (string, *httptransport.Server)
- func NewCreateHandler(ctx context.Context, svc AccountService, opts *kitworker.ServerOption, ...) (string, *httptransport.Server)
- func NewDeleteHandler(ctx context.Context, svc AccountService, opts *kitworker.ServerOption, ...) (string, *httptransport.Server)
- func NewOneHandler(ctx context.Context, svc AccountService, opts *kitworker.ServerOption, ...) (string, *httptransport.Server)
- func NewUpdateHandler(ctx context.Context, svc AccountService, opts *kitworker.ServerOption, ...) (string, *httptransport.Server)
- func RegisterHandlers(ctx context.Context, svc AccountService, serverOpts *kitworker.ServerOption, ...)
- type AccountClient
- func (a *AccountClient) ByFacebookIDs(ctx context.Context, req *[]string) (*[]*models.Account, error)
- func (a *AccountClient) ByIDs(ctx context.Context, req *[]int64) (*[]*models.Account, error)
- func (a *AccountClient) Create(ctx context.Context, req *models.Account) (*models.Account, error)
- func (a *AccountClient) Delete(ctx context.Context, req *int64) (*models.Account, error)
- func (a *AccountClient) One(ctx context.Context, req *int64) (*models.Account, error)
- func (a *AccountClient) Update(ctx context.Context, req *models.Account) (*models.Account, error)
- type AccountService
Constants ¶
const ( EndpointNameByFacebookIDs = "byfacebookids" EndpointNameByIDs = "byids" EndpointNameCreate = "create" EndpointNameDelete = "delete" EndpointNameOne = "one" EndpointNameUpdate = "update" )
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) Delete ¶
Delete deletes the account from the system with given account id. Deletes are soft.
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