mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-11 10:54:28 +00:00
docs
This commit is contained in:
@@ -20,6 +20,7 @@ const (
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// Get the list of countries that are supported by this API
|
||||
type CountriesRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
@@ -162,6 +163,7 @@ func (x *Country) GetName() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// List the holiday dates for a given country and year
|
||||
type ListRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
|
||||
@@ -42,9 +42,7 @@ func NewHolidaysEndpoints() []*api.Endpoint {
|
||||
// Client API for Holidays service
|
||||
|
||||
type HolidaysService interface {
|
||||
// Get the list of countries that are supported by this API
|
||||
Countries(ctx context.Context, in *CountriesRequest, opts ...client.CallOption) (*CountriesResponse, error)
|
||||
// List the holiday dates for a given country and year
|
||||
List(ctx context.Context, in *ListRequest, opts ...client.CallOption) (*ListResponse, error)
|
||||
}
|
||||
|
||||
@@ -83,9 +81,7 @@ func (c *holidaysService) List(ctx context.Context, in *ListRequest, opts ...cli
|
||||
// Server API for Holidays service
|
||||
|
||||
type HolidaysHandler interface {
|
||||
// Get the list of countries that are supported by this API
|
||||
Countries(context.Context, *CountriesRequest, *CountriesResponse) error
|
||||
// List the holiday dates for a given country and year
|
||||
List(context.Context, *ListRequest, *ListResponse) error
|
||||
}
|
||||
|
||||
|
||||
@@ -5,12 +5,11 @@ package holidays;
|
||||
option go_package = "./proto;holidays";
|
||||
|
||||
service Holidays {
|
||||
// Get the list of countries that are supported by this API
|
||||
rpc Countries(CountriesRequest) returns (CountriesResponse) {}
|
||||
// List the holiday dates for a given country and year
|
||||
rpc List(ListRequest) returns (ListResponse) {}
|
||||
}
|
||||
|
||||
// Get the list of countries that are supported by this API
|
||||
message CountriesRequest {
|
||||
}
|
||||
|
||||
@@ -25,6 +24,7 @@ message Country {
|
||||
string name = 2;
|
||||
}
|
||||
|
||||
// List the holiday dates for a given country and year
|
||||
message ListRequest {
|
||||
// The 2 letter country code (as defined in ISO 3166-1 alpha-2)
|
||||
string country_code = 1;
|
||||
|
||||
Reference in New Issue
Block a user