Documentation ¶
Overview ¶
Package handler provides the functionality of HTTP/2 gRPC gateway. It receives request and returns response.
Index ¶
- type AptxService
- func (as *AptxService) GetAllURL(ctx context.Context, request *aptxv1.GetAllURLRequest) (*aptxv1.GetAllURLResponse, error)
- func (as *AptxService) GetURLDetail(ctx context.Context, request *aptxv1.GetURLDetailRequest) (*aptxv1.GetURLDetailResponse, error)
- func (as *AptxService) ShortenURL(ctx context.Context, request *aptxv1.ShortenURLRequest) (*aptxv1.ShortenURLResponse, error)
- func (as *AptxService) StreamAllURL(request *aptxv1.StreamAllURLRequest, ...) error
- type HealthService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AptxService ¶
type AptxService struct { aptxv1.UnimplementedAptxServiceServer // contains filtered or unexported fields }
AptxService handles HTTP/2 gRPC request for URL aptx. It implements gRPC service server.
func NewAptxService ¶
func NewAptxService(creator usecase.CreateShortURL, getter usecase.GetURL) *AptxService
NewAptxService creates an instance of AptxService.
func (*AptxService) GetAllURL ¶
func (as *AptxService) GetAllURL(ctx context.Context, request *aptxv1.GetAllURLRequest) (*aptxv1.GetAllURLResponse, error)
GetAllURL handles HTTP/2 gRPC request similar to GET in HTTP/1.1. Its specific job is to get all available URLs in the system.
func (*AptxService) GetURLDetail ¶
func (as *AptxService) GetURLDetail(ctx context.Context, request *aptxv1.GetURLDetailRequest) (*aptxv1.GetURLDetailResponse, error)
GetURLDetail handles HTTP/2 gRPC request similar to GET in HTTP/1.1. Its specific job is to get a detail of a single short URL.
func (*AptxService) ShortenURL ¶
func (as *AptxService) ShortenURL(ctx context.Context, request *aptxv1.ShortenURLRequest) (*aptxv1.ShortenURLResponse, error)
ShortenURL handles HTTP/2 gRPC request similar to POST in HTTP/1.1.
func (*AptxService) StreamAllURL ¶
func (as *AptxService) StreamAllURL(request *aptxv1.StreamAllURLRequest, stream aptxv1.AptxService_StreamAllURLServer) error
StreamAllURL handles HTTP/2 gRPC request similar to GET in HTTP/1.1. Its specific job is to get all available URLs in the system using stream.
type HealthService ¶
type HealthService struct { grpchealthv1.UnimplementedHealthServer // contains filtered or unexported fields }
HealthService handles HTTP/2 gRPC request for health checking.
func NewHealthService ¶
func NewHealthService(checker usecase.CheckHealth) *HealthService
NewHealthService creates an instance of HealthService.
func (*HealthService) Check ¶
func (hc *HealthService) Check(ctx context.Context, request *grpchealthv1.HealthCheckRequest) (*grpchealthv1.HealthCheckResponse, error)
Check checks the entire system health, including its dependecies.