profile

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"
	EndpointNameMarkAs = "markas"
	EndpointNameOne    = "one"
	EndpointNameUpdate = "update"
)
View Source
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) Create

func (p *ProfileClient) Create(ctx context.Context, req *models.Profile) (*models.Profile, error)

Create creates a new profile on the system with given profile data.

func (*ProfileClient) Delete

func (p *ProfileClient) Delete(ctx context.Context, req *int64) (*models.Profile, error)

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

func (*ProfileClient) MarkAs

MarkAs marks given account with given type constant, will be used mostly for marking as bot.

func (*ProfileClient) One

func (p *ProfileClient) One(ctx context.Context, req *int64) (*models.Profile, error)

One returns the respective account with the given ID.

func (*ProfileClient) Update

func (p *ProfileClient) Update(ctx context.Context, req *models.Profile) (*models.Profile, error)

Update updates a new profile on the system with given profile data.

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

Jump to

Keyboard shortcuts

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