mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-22 07:15:25 +00:00
Fix url (#105)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
||||
// source: proto/url.proto
|
||||
|
||||
package urlshortener
|
||||
package url
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
@@ -33,34 +33,34 @@ var _ context.Context
|
||||
var _ client.Option
|
||||
var _ server.Option
|
||||
|
||||
// Api Endpoints for UrlShortener service
|
||||
// Api Endpoints for Url service
|
||||
|
||||
func NewUrlShortenerEndpoints() []*api.Endpoint {
|
||||
func NewUrlEndpoints() []*api.Endpoint {
|
||||
return []*api.Endpoint{}
|
||||
}
|
||||
|
||||
// Client API for UrlShortener service
|
||||
// Client API for Url service
|
||||
|
||||
type UrlShortenerService interface {
|
||||
type UrlService interface {
|
||||
Shorten(ctx context.Context, in *ShortenRequest, opts ...client.CallOption) (*ShortenResponse, error)
|
||||
List(ctx context.Context, in *ListRequest, opts ...client.CallOption) (*ListResponse, error)
|
||||
Proxy(ctx context.Context, in *ProxyRequest, opts ...client.CallOption) (*ProxyResponse, error)
|
||||
}
|
||||
|
||||
type urlShortenerService struct {
|
||||
type urlService struct {
|
||||
c client.Client
|
||||
name string
|
||||
}
|
||||
|
||||
func NewUrlShortenerService(name string, c client.Client) UrlShortenerService {
|
||||
return &urlShortenerService{
|
||||
func NewUrlService(name string, c client.Client) UrlService {
|
||||
return &urlService{
|
||||
c: c,
|
||||
name: name,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *urlShortenerService) Shorten(ctx context.Context, in *ShortenRequest, opts ...client.CallOption) (*ShortenResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "UrlShortener.Shorten", in)
|
||||
func (c *urlService) Shorten(ctx context.Context, in *ShortenRequest, opts ...client.CallOption) (*ShortenResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Url.Shorten", in)
|
||||
out := new(ShortenResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
@@ -69,8 +69,8 @@ func (c *urlShortenerService) Shorten(ctx context.Context, in *ShortenRequest, o
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *urlShortenerService) List(ctx context.Context, in *ListRequest, opts ...client.CallOption) (*ListResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "UrlShortener.List", in)
|
||||
func (c *urlService) List(ctx context.Context, in *ListRequest, opts ...client.CallOption) (*ListResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Url.List", in)
|
||||
out := new(ListResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
@@ -79,8 +79,8 @@ func (c *urlShortenerService) List(ctx context.Context, in *ListRequest, opts ..
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *urlShortenerService) Proxy(ctx context.Context, in *ProxyRequest, opts ...client.CallOption) (*ProxyResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "UrlShortener.Proxy", in)
|
||||
func (c *urlService) Proxy(ctx context.Context, in *ProxyRequest, opts ...client.CallOption) (*ProxyResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Url.Proxy", in)
|
||||
out := new(ProxyResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
@@ -89,39 +89,39 @@ func (c *urlShortenerService) Proxy(ctx context.Context, in *ProxyRequest, opts
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for UrlShortener service
|
||||
// Server API for Url service
|
||||
|
||||
type UrlShortenerHandler interface {
|
||||
type UrlHandler interface {
|
||||
Shorten(context.Context, *ShortenRequest, *ShortenResponse) error
|
||||
List(context.Context, *ListRequest, *ListResponse) error
|
||||
Proxy(context.Context, *ProxyRequest, *ProxyResponse) error
|
||||
}
|
||||
|
||||
func RegisterUrlShortenerHandler(s server.Server, hdlr UrlShortenerHandler, opts ...server.HandlerOption) error {
|
||||
type urlShortener interface {
|
||||
func RegisterUrlHandler(s server.Server, hdlr UrlHandler, opts ...server.HandlerOption) error {
|
||||
type url interface {
|
||||
Shorten(ctx context.Context, in *ShortenRequest, out *ShortenResponse) error
|
||||
List(ctx context.Context, in *ListRequest, out *ListResponse) error
|
||||
Proxy(ctx context.Context, in *ProxyRequest, out *ProxyResponse) error
|
||||
}
|
||||
type UrlShortener struct {
|
||||
urlShortener
|
||||
type Url struct {
|
||||
url
|
||||
}
|
||||
h := &urlShortenerHandler{hdlr}
|
||||
return s.Handle(s.NewHandler(&UrlShortener{h}, opts...))
|
||||
h := &urlHandler{hdlr}
|
||||
return s.Handle(s.NewHandler(&Url{h}, opts...))
|
||||
}
|
||||
|
||||
type urlShortenerHandler struct {
|
||||
UrlShortenerHandler
|
||||
type urlHandler struct {
|
||||
UrlHandler
|
||||
}
|
||||
|
||||
func (h *urlShortenerHandler) Shorten(ctx context.Context, in *ShortenRequest, out *ShortenResponse) error {
|
||||
return h.UrlShortenerHandler.Shorten(ctx, in, out)
|
||||
func (h *urlHandler) Shorten(ctx context.Context, in *ShortenRequest, out *ShortenResponse) error {
|
||||
return h.UrlHandler.Shorten(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *urlShortenerHandler) List(ctx context.Context, in *ListRequest, out *ListResponse) error {
|
||||
return h.UrlShortenerHandler.List(ctx, in, out)
|
||||
func (h *urlHandler) List(ctx context.Context, in *ListRequest, out *ListResponse) error {
|
||||
return h.UrlHandler.List(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *urlShortenerHandler) Proxy(ctx context.Context, in *ProxyRequest, out *ProxyResponse) error {
|
||||
return h.UrlShortenerHandler.Proxy(ctx, in, out)
|
||||
func (h *urlHandler) Proxy(ctx context.Context, in *ProxyRequest, out *ProxyResponse) error {
|
||||
return h.UrlHandler.Proxy(ctx, in, out)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user