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: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Success = 1
	Fail    = 0
)

Variables

This section is empty.

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 {
	CreateAppEndpoint endpoint.Endpoint
	AppInfoEndpoint   endpoint.Endpoint
	RemoveAppEndpoint endpoint.Endpoint
	UpdateAppEndpoint 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(ID *string, reply *int) error

func (*RpcService) FindByID

func (s *RpcService) FindByID(ID *int, reply *app.App) error

func (*RpcService) Insert

func (s *RpcService) Insert(args *app.App, reply *int) error

func (*RpcService) InsertAppUser

func (s *RpcService) InsertAppUser(args *app.AppUser, reply *int) error

func (*RpcService) Update

func (s *RpcService) Update(args *app.App, reply *int) error

type Service

type Service interface {
	CreateApp(req *createAppRequest) (res *createAppResponse, err error)
	AppInfo(req *appInfoRequest) (res *appInfoResponse, err error)
	UpdateApp(req *updateAppRequest) (result *int, err error)
	RemoveApp(req *removeAppRequest) (result *int, err error)
}
r.Methods("POST").Path("/create").Handler(createAppHandler)

r.Methods("POST").Path("/remove").Handler(removeAppHandler) r.Methods("POST").Path("/info").Handler(appInfoHandler) r.Methods("POST").Path("/update").Handler(updateAppHandler)

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