publishing

package
v0.0.0-...-3650569 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: GPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Success = 1
	Fail    = 0
)

Variables

View Source
var (
	ErrInvalidUser  = errors.New("invalid user")
	ErrInvalidToken = errors.New("invalid token")
)

Functions

func MakeHttpHandler

func MakeHttpHandler(log kitlog.Logger, s Service) *mux.Router

func RegisterRPCService

func RegisterRPCService(log kitlog.Logger, repo rel.Repository, config *viper.Viper)

Types

type Endpoints

type Endpoints struct {
	LoginEndpoint    endpoint.Endpoint
	RegisterEndpoint endpoint.Endpoint
}

func MakeEndpoints

func MakeEndpoints(s Service) Endpoints

type RpcService

type RpcService struct {
	Repo rel.Repository

	Log kitlog.Logger
	// contains filtered or unexported fields
}

func (*RpcService) Delete

func (s *RpcService) Delete(userID *int, reply *int) error

func (*RpcService) FindByAccount

func (s *RpcService) FindByAccount(account string, reply *user.User) error

func (*RpcService) FindByID

func (s *RpcService) FindByID(userID *int, reply *user.User) error

func (*RpcService) Insert

func (s *RpcService) Insert(args *user.User, reply *int) error

func (*RpcService) Update

func (s *RpcService) Update(args *user.User, reply *int) error

type Service

type Service interface {
	Login(req *loginRequest) (res loginResponse, err error)
	Register(req *registerRequest) (res registerResponse, err error)
}

func New

func New(log kitlog.Logger, config *viper.Viper) Service

Jump to

Keyboard shortcuts

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