Implement new interface
This commit is contained in:
		@@ -37,6 +37,7 @@ type AuthService interface {
 | 
			
		||||
	Generate(ctx context.Context, in *GenerateRequest, opts ...client.CallOption) (*GenerateResponse, error)
 | 
			
		||||
	Inspect(ctx context.Context, in *InspectRequest, opts ...client.CallOption) (*InspectResponse, error)
 | 
			
		||||
	Token(ctx context.Context, in *TokenRequest, opts ...client.CallOption) (*TokenResponse, error)
 | 
			
		||||
	Login(ctx context.Context, in *LoginRequest, opts ...client.CallOption) (*LoginResponse, error)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type authService struct {
 | 
			
		||||
@@ -81,12 +82,23 @@ func (c *authService) Token(ctx context.Context, in *TokenRequest, opts ...clien
 | 
			
		||||
	return out, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *authService) Login(ctx context.Context, in *LoginRequest, opts ...client.CallOption) (*LoginResponse, error) {
 | 
			
		||||
	req := c.c.NewRequest(c.name, "Auth.Login", in)
 | 
			
		||||
	out := new(LoginResponse)
 | 
			
		||||
	err := c.c.Call(ctx, req, out, opts...)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
	return out, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Server API for Auth service
 | 
			
		||||
 | 
			
		||||
type AuthHandler interface {
 | 
			
		||||
	Generate(context.Context, *GenerateRequest, *GenerateResponse) error
 | 
			
		||||
	Inspect(context.Context, *InspectRequest, *InspectResponse) error
 | 
			
		||||
	Token(context.Context, *TokenRequest, *TokenResponse) error
 | 
			
		||||
	Login(context.Context, *LoginRequest, *LoginResponse) error
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func RegisterAuthHandler(s server.Server, hdlr AuthHandler, opts ...server.HandlerOption) error {
 | 
			
		||||
@@ -94,6 +106,7 @@ func RegisterAuthHandler(s server.Server, hdlr AuthHandler, opts ...server.Handl
 | 
			
		||||
		Generate(ctx context.Context, in *GenerateRequest, out *GenerateResponse) error
 | 
			
		||||
		Inspect(ctx context.Context, in *InspectRequest, out *InspectResponse) error
 | 
			
		||||
		Token(ctx context.Context, in *TokenRequest, out *TokenResponse) error
 | 
			
		||||
		Login(ctx context.Context, in *LoginRequest, out *LoginResponse) error
 | 
			
		||||
	}
 | 
			
		||||
	type Auth struct {
 | 
			
		||||
		auth
 | 
			
		||||
@@ -118,6 +131,10 @@ func (h *authHandler) Token(ctx context.Context, in *TokenRequest, out *TokenRes
 | 
			
		||||
	return h.AuthHandler.Token(ctx, in, out)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (h *authHandler) Login(ctx context.Context, in *LoginRequest, out *LoginResponse) error {
 | 
			
		||||
	return h.AuthHandler.Login(ctx, in, out)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Client API for Accounts service
 | 
			
		||||
 | 
			
		||||
type AccountsService interface {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user