Documentation ¶
Index ¶
- Constants
- func NewCreateHandler(ctx context.Context, svc ProfileService, opts *kitworker.ServerOption, ...) (string, *httptransport.Server)
- func NewDeleteHandler(ctx context.Context, svc ProfileService, opts *kitworker.ServerOption, ...) (string, *httptransport.Server)
- func NewMarkAsHandler(ctx context.Context, svc ProfileService, opts *kitworker.ServerOption, ...) (string, *httptransport.Server)
- func NewOneHandler(ctx context.Context, svc ProfileService, opts *kitworker.ServerOption, ...) (string, *httptransport.Server)
- func NewUpdateHandler(ctx context.Context, svc ProfileService, opts *kitworker.ServerOption, ...) (string, *httptransport.Server)
- func RegisterHandlers(ctx context.Context, svc ProfileService, serverOpts *kitworker.ServerOption, ...)
- type ProfileClient
- func (p *ProfileClient) Create(ctx context.Context, req *models.Profile) (*models.Profile, error)
- func (p *ProfileClient) Delete(ctx context.Context, req *int64) (*models.Profile, error)
- func (p *ProfileClient) MarkAs(ctx context.Context, req *models.MarkAsRequest) (*models.Profile, error)
- func (p *ProfileClient) One(ctx context.Context, req *int64) (*models.Profile, error)
- func (p *ProfileClient) Update(ctx context.Context, req *models.Profile) (*models.Profile, error)
- type ProfileService
Constants ¶
const ( EndpointNameCreate = "create" EndpointNameDelete = "delete" EndpointNameMarkAs = "markas" EndpointNameOne = "one" EndpointNameUpdate = "update" )
const ServiceName = "profile"
Variables ¶
This section is empty.
Functions ¶
func NewCreateHandler ¶
func NewCreateHandler(ctx context.Context, svc ProfileService, opts *kitworker.ServerOption, logger log.Logger) (string, *httptransport.Server)
Create creates a new profile on the system with given profile data.
func NewDeleteHandler ¶
func NewDeleteHandler(ctx context.Context, svc ProfileService, opts *kitworker.ServerOption, logger log.Logger) (string, *httptransport.Server)
Delete deletes the profile from the system with given profile id. Deletes are soft.
func NewMarkAsHandler ¶
func NewMarkAsHandler(ctx context.Context, svc ProfileService, opts *kitworker.ServerOption, logger log.Logger) (string, *httptransport.Server)
MarkAs marks given account with given type constant, will be used mostly for marking as bot.
func NewOneHandler ¶
func NewOneHandler(ctx context.Context, svc ProfileService, opts *kitworker.ServerOption, logger log.Logger) (string, *httptransport.Server)
One returns the respective account with the given ID.
func NewUpdateHandler ¶
func NewUpdateHandler(ctx context.Context, svc ProfileService, opts *kitworker.ServerOption, logger log.Logger) (string, *httptransport.Server)
Update updates a new profile on the system with given profile data.
func RegisterHandlers ¶
func RegisterHandlers(ctx context.Context, svc ProfileService, serverOpts *kitworker.ServerOption, logger log.Logger)
RegisterHandlers registers handlers of ProfileService to the http.DefaultServeMux
Types ¶
type ProfileClient ¶
type ProfileClient struct { // CreateLoadBalancer provides remote call to create endpoints CreateLoadBalancer lb.Balancer // DeleteLoadBalancer provides remote call to delete endpoints DeleteLoadBalancer lb.Balancer // MarkAsLoadBalancer provides remote call to markas endpoints MarkAsLoadBalancer lb.Balancer // OneLoadBalancer provides remote call to one endpoints OneLoadBalancer lb.Balancer // UpdateLoadBalancer provides remote call to update endpoints UpdateLoadBalancer lb.Balancer }
ProfileClient holds remote endpoint functions Satisfies ProfileService interface
func NewProfileClient ¶
func NewProfileClient(clientOpts *kitworker.ClientOption, logger log.Logger) *ProfileClient
NewProfileClient creates a new client for ProfileService
func (*ProfileClient) Delete ¶
Delete deletes the profile from the system with given profile id. Deletes are soft.
func (*ProfileClient) MarkAs ¶
func (p *ProfileClient) MarkAs(ctx context.Context, req *models.MarkAsRequest) (*models.Profile, error)
MarkAs marks given account with given type constant, will be used mostly for marking as bot.
type ProfileService ¶
type ProfileService interface { // Create creates a new profile on the system with given profile data. Create(ctx context.Context, req *models.Profile) (res *models.Profile, err error) // Delete deletes the profile from the system with given profile id. Deletes are // soft. Delete(ctx context.Context, req *int64) (res *models.Profile, err error) // MarkAs marks given account with given type constant, will be used mostly for // marking as bot. MarkAs(ctx context.Context, req *models.MarkAsRequest) (res *models.Profile, err error) // One returns the respective account with the given ID. One(ctx context.Context, req *int64) (res *models.Profile, err error) // Update updates a new profile on the system with given profile data. Update(ctx context.Context, req *models.Profile) (res *models.Profile, err error) }
Profile represents a registered Account's Public Info
func NewProfile ¶
func NewProfile() ProfileService