transport

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCommentEndpoint

func CreateCommentEndpoint(svc usersvc.UserService) endpoint.Endpoint

func CreateUserEndpoint

func CreateUserEndpoint(svc usersvc.UserService) endpoint.Endpoint

func FindUsersEndpoint

func FindUsersEndpoint(svc usersvc.UserService) endpoint.Endpoint

func GetCommentEndpoint

func GetCommentEndpoint(svc usersvc.UserService) endpoint.Endpoint

func GetUserCommentsEndpoint

func GetUserCommentsEndpoint(svc usersvc.UserService) endpoint.Endpoint

func GetUserEndpoint

func GetUserEndpoint(svc usersvc.UserService) endpoint.Endpoint

func LatencyMiddleware

func LatencyMiddleware(dur metrics.Histogram, methodName string) endpoint.Middleware

func RequestFrequencyMiddleware

func RequestFrequencyMiddleware(freq metrics.Gauge, methodName string) endpoint.Middleware

func UpdateUserEndpoint

func UpdateUserEndpoint(svc usersvc.UserService) endpoint.Endpoint

Types

type CreateCommentRequest

type CreateCommentRequest struct {
	Comment usersvc.Comment `json:"comment"`
}

type CreateCommentResponse

type CreateCommentResponse struct {
	Id string `json:"id"`
}

type CreateUserRequest

type CreateUserRequest struct {
	User usersvc.User `json:"user"`
}

type CreateUserResponse

type CreateUserResponse struct {
	Id string `json:"id"`
}

type EndpointsSet

type EndpointsSet struct {
	CreateUserEndpoint      endpoint.Endpoint
	UpdateUserEndpoint      endpoint.Endpoint
	GetUserEndpoint         endpoint.Endpoint
	FindUsersEndpoint       endpoint.Endpoint
	CreateCommentEndpoint   endpoint.Endpoint
	GetCommentEndpoint      endpoint.Endpoint
	GetUserCommentsEndpoint endpoint.Endpoint
}

EndpointsSet implements UserService API and used for transport purposes.

func Endpoints

func Endpoints(svc usersvc.UserService) EndpointsSet

func InstrumentingEndpoints

func InstrumentingEndpoints(endpoints EndpointsSet, tracer opentracinggo.Tracer) EndpointsSet

func TraceClientEndpoints

func TraceClientEndpoints(endpoints EndpointsSet, tracer opentracinggo.Tracer) EndpointsSet

TraceClientEndpoints is used for tracing endpoints on client side.

func TraceServerEndpoints

func TraceServerEndpoints(endpoints EndpointsSet, tracer opentracinggo.Tracer) EndpointsSet

TraceServerEndpoints is used for tracing endpoints on server side.

func (EndpointsSet) CreateComment

func (set EndpointsSet) CreateComment(arg0 context.Context, arg1 usersvc.Comment) (res0 string, res1 error)

func (EndpointsSet) CreateUser

func (set EndpointsSet) CreateUser(arg0 context.Context, arg1 usersvc.User) (res0 string, res1 error)

func (EndpointsSet) FindUsers

func (set EndpointsSet) FindUsers(arg0 context.Context) (res0 map[string]usersvc.User, res1 error)

func (EndpointsSet) GetComment

func (set EndpointsSet) GetComment(arg0 context.Context, arg1 string) (res0 usersvc.Comment, res1 error)

func (EndpointsSet) GetUser

func (set EndpointsSet) GetUser(arg0 context.Context, arg1 string) (res0 usersvc.User, res1 error)

func (EndpointsSet) GetUserComments

func (set EndpointsSet) GetUserComments(arg0 context.Context, arg1 string) (res0 []usersvc.Comment, res1 error)

func (EndpointsSet) UpdateUser

func (set EndpointsSet) UpdateUser(arg0 context.Context, arg1 usersvc.User) (res0 error)

type FindUsersRequest

type FindUsersRequest struct{}

Formal exchange type, please do not delete.

type FindUsersResponse

type FindUsersResponse struct {
	Results map[string]usersvc.User `json:"results"`
}

type GetCommentRequest

type GetCommentRequest struct {
	Id string `json:"id"`
}

type GetCommentResponse

type GetCommentResponse struct {
	Comment usersvc.Comment `json:"comment"`
}

type GetUserCommentsRequest

type GetUserCommentsRequest struct {
	UserId string `json:"user_id"`
}

type GetUserCommentsResponse

type GetUserCommentsResponse struct {
	List []usersvc.Comment `json:"list"`
}

type GetUserRequest

type GetUserRequest struct {
	Id string `json:"id"`
}

type GetUserResponse

type GetUserResponse struct {
	User usersvc.User `json:"user"`
}

type UpdateUserRequest

type UpdateUserRequest struct {
	User usersvc.User `json:"user"`
}

type UpdateUserResponse

type UpdateUserResponse struct{}

Formal exchange type, please do not delete.

Directories

Path Synopsis
Please, do not change functions names! It is better for you if you do not change functions names! This file will never be overwritten.
Please, do not change functions names! It is better for you if you do not change functions names! This file will never be overwritten.
Please, do not change functions names!
Please, do not change functions names!

Jump to

Keyboard shortcuts

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