You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
156 lines
4.7 KiB
Go
156 lines
4.7 KiB
Go
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
|
// source: settingspb.proto
|
|
|
|
package settingspb
|
|
|
|
import (
|
|
fmt "fmt"
|
|
proto "google.golang.org/protobuf/proto"
|
|
math "math"
|
|
)
|
|
|
|
import (
|
|
context "context"
|
|
api "go-micro.dev/v4/api"
|
|
client "go-micro.dev/v4/client"
|
|
server "go-micro.dev/v4/server"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ api.Endpoint
|
|
var _ context.Context
|
|
var _ client.Option
|
|
var _ server.Option
|
|
|
|
// Api Endpoints for SettingsService service
|
|
|
|
func NewSettingsServiceEndpoints() []*api.Endpoint {
|
|
return []*api.Endpoint{}
|
|
}
|
|
|
|
// Client API for SettingsService service
|
|
|
|
type SettingsService interface {
|
|
Create(ctx context.Context, in *CreateRequest, opts ...client.CallOption) (*Setting, error)
|
|
Update(ctx context.Context, in *UpdateRequest, opts ...client.CallOption) (*Setting, error)
|
|
Upsert(ctx context.Context, in *UpsertRequest, opts ...client.CallOption) (*Setting, error)
|
|
Get(ctx context.Context, in *GetRequest, opts ...client.CallOption) (*Setting, error)
|
|
List(ctx context.Context, in *ListRequest, opts ...client.CallOption) (*SettingsList, error)
|
|
}
|
|
|
|
type settingsService struct {
|
|
c client.Client
|
|
name string
|
|
}
|
|
|
|
func NewSettingsService(name string, c client.Client) SettingsService {
|
|
return &settingsService{
|
|
c: c,
|
|
name: name,
|
|
}
|
|
}
|
|
|
|
func (c *settingsService) Create(ctx context.Context, in *CreateRequest, opts ...client.CallOption) (*Setting, error) {
|
|
req := c.c.NewRequest(c.name, "SettingsService.Create", in)
|
|
out := new(Setting)
|
|
err := c.c.Call(ctx, req, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *settingsService) Update(ctx context.Context, in *UpdateRequest, opts ...client.CallOption) (*Setting, error) {
|
|
req := c.c.NewRequest(c.name, "SettingsService.Update", in)
|
|
out := new(Setting)
|
|
err := c.c.Call(ctx, req, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *settingsService) Upsert(ctx context.Context, in *UpsertRequest, opts ...client.CallOption) (*Setting, error) {
|
|
req := c.c.NewRequest(c.name, "SettingsService.Upsert", in)
|
|
out := new(Setting)
|
|
err := c.c.Call(ctx, req, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *settingsService) Get(ctx context.Context, in *GetRequest, opts ...client.CallOption) (*Setting, error) {
|
|
req := c.c.NewRequest(c.name, "SettingsService.Get", in)
|
|
out := new(Setting)
|
|
err := c.c.Call(ctx, req, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *settingsService) List(ctx context.Context, in *ListRequest, opts ...client.CallOption) (*SettingsList, error) {
|
|
req := c.c.NewRequest(c.name, "SettingsService.List", in)
|
|
out := new(SettingsList)
|
|
err := c.c.Call(ctx, req, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// Server API for SettingsService service
|
|
|
|
type SettingsServiceHandler interface {
|
|
Create(context.Context, *CreateRequest, *Setting) error
|
|
Update(context.Context, *UpdateRequest, *Setting) error
|
|
Upsert(context.Context, *UpsertRequest, *Setting) error
|
|
Get(context.Context, *GetRequest, *Setting) error
|
|
List(context.Context, *ListRequest, *SettingsList) error
|
|
}
|
|
|
|
func RegisterSettingsServiceHandler(s server.Server, hdlr SettingsServiceHandler, opts ...server.HandlerOption) error {
|
|
type settingsService interface {
|
|
Create(ctx context.Context, in *CreateRequest, out *Setting) error
|
|
Update(ctx context.Context, in *UpdateRequest, out *Setting) error
|
|
Upsert(ctx context.Context, in *UpsertRequest, out *Setting) error
|
|
Get(ctx context.Context, in *GetRequest, out *Setting) error
|
|
List(ctx context.Context, in *ListRequest, out *SettingsList) error
|
|
}
|
|
type SettingsService struct {
|
|
settingsService
|
|
}
|
|
h := &settingsServiceHandler{hdlr}
|
|
return s.Handle(s.NewHandler(&SettingsService{h}, opts...))
|
|
}
|
|
|
|
type settingsServiceHandler struct {
|
|
SettingsServiceHandler
|
|
}
|
|
|
|
func (h *settingsServiceHandler) Create(ctx context.Context, in *CreateRequest, out *Setting) error {
|
|
return h.SettingsServiceHandler.Create(ctx, in, out)
|
|
}
|
|
|
|
func (h *settingsServiceHandler) Update(ctx context.Context, in *UpdateRequest, out *Setting) error {
|
|
return h.SettingsServiceHandler.Update(ctx, in, out)
|
|
}
|
|
|
|
func (h *settingsServiceHandler) Upsert(ctx context.Context, in *UpsertRequest, out *Setting) error {
|
|
return h.SettingsServiceHandler.Upsert(ctx, in, out)
|
|
}
|
|
|
|
func (h *settingsServiceHandler) Get(ctx context.Context, in *GetRequest, out *Setting) error {
|
|
return h.SettingsServiceHandler.Get(ctx, in, out)
|
|
}
|
|
|
|
func (h *settingsServiceHandler) List(ctx context.Context, in *ListRequest, out *SettingsList) error {
|
|
return h.SettingsServiceHandler.List(ctx, in, out)
|
|
}
|