handler

package
v0.0.0-...-93f29c8 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// URLSafeRegex is a function which returns true if a string is URL safe
	URLSafeRegex = regexp.MustCompile(`^[A-Za-z0-9_-].*?$`).MatchString
)

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler implements the users service interface

func NewHandler

func NewHandler(srv micro.Service) (*Handler, error)

NewHandler returns an initialised handler

func (*Handler) Create

func (h *Handler) Create(ctx context.Context, req *pb.CreateRequest, rsp *pb.CreateResponse) error

Create inserts a new user into the the store

func (*Handler) Delete

func (h *Handler) Delete(ctx context.Context, req *pb.DeleteRequest, rsp *pb.DeleteResponse) error

Delete a user in the store

func (*Handler) Read

func (h *Handler) Read(ctx context.Context, req *pb.ReadRequest, rsp *pb.ReadResponse) error

Read retirves a user from the store

func (*Handler) Search

func (h *Handler) Search(ctx context.Context, req *pb.SearchRequest, rsp *pb.SearchResponse) error

Search the users in th store, using username

func (*Handler) Update

func (h *Handler) Update(ctx context.Context, req *pb.UpdateRequest, rsp *pb.UpdateResponse) error

Update modifies a user in the store

Jump to

Keyboard shortcuts

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