holidays

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2023 License: Apache-2.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_holidays_proto protoreflect.FileDescriptor

Functions

func NewHolidaysEndpoints

func NewHolidaysEndpoints() []*api.Endpoint

func RegisterHolidaysHandler

func RegisterHolidaysHandler(s server.Server, hdlr HolidaysHandler, opts ...server.HandlerOption) error

Types

type CountriesRequest

type CountriesRequest struct {
	// contains filtered or unexported fields
}

Get the list of countries that are supported by this API

func (*CountriesRequest) Descriptor deprecated

func (*CountriesRequest) Descriptor() ([]byte, []int)

Deprecated: Use CountriesRequest.ProtoReflect.Descriptor instead.

func (*CountriesRequest) ProtoMessage

func (*CountriesRequest) ProtoMessage()

func (*CountriesRequest) ProtoReflect

func (x *CountriesRequest) ProtoReflect() protoreflect.Message

func (*CountriesRequest) Reset

func (x *CountriesRequest) Reset()

func (*CountriesRequest) String

func (x *CountriesRequest) String() string

type CountriesResponse

type CountriesResponse struct {
	Countries []*Country `protobuf:"bytes,1,rep,name=countries,proto3" json:"countries,omitempty"`
	// contains filtered or unexported fields
}

func (*CountriesResponse) Descriptor deprecated

func (*CountriesResponse) Descriptor() ([]byte, []int)

Deprecated: Use CountriesResponse.ProtoReflect.Descriptor instead.

func (*CountriesResponse) GetCountries

func (x *CountriesResponse) GetCountries() []*Country

func (*CountriesResponse) ProtoMessage

func (*CountriesResponse) ProtoMessage()

func (*CountriesResponse) ProtoReflect

func (x *CountriesResponse) ProtoReflect() protoreflect.Message

func (*CountriesResponse) Reset

func (x *CountriesResponse) Reset()

func (*CountriesResponse) String

func (x *CountriesResponse) String() string

type Country

type Country struct {

	// The 2 letter country code (as defined in ISO 3166-1 alpha-2)
	Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
	// The English name of the country
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*Country) Descriptor deprecated

func (*Country) Descriptor() ([]byte, []int)

Deprecated: Use Country.ProtoReflect.Descriptor instead.

func (*Country) GetCode

func (x *Country) GetCode() string

func (*Country) GetName

func (x *Country) GetName() string

func (*Country) ProtoMessage

func (*Country) ProtoMessage()

func (*Country) ProtoReflect

func (x *Country) ProtoReflect() protoreflect.Message

func (*Country) Reset

func (x *Country) Reset()

func (*Country) String

func (x *Country) String() string

type Holiday

type Holiday struct {

	// date of the holiday in yyyy-mm-dd format
	Date string `protobuf:"bytes,1,opt,name=date,proto3" json:"date,omitempty"`
	// the name of the holiday in English
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// the local name of the holiday
	LocalName string `protobuf:"bytes,3,opt,name=local_name,json=localName,proto3" json:"local_name,omitempty"`
	// the country this holiday occurs in
	CountryCode string `protobuf:"bytes,4,opt,name=country_code,json=countryCode,proto3" json:"country_code,omitempty"`
	// the regions within the country that observe this holiday (if not all of them)
	Regions []string `protobuf:"bytes,5,rep,name=regions,proto3" json:"regions,omitempty"`
	// the type of holiday Public, Bank, School, Authorities, Optional, Observance
	Types []string `protobuf:"bytes,6,rep,name=types,proto3" json:"types,omitempty"`
	// contains filtered or unexported fields
}

func (*Holiday) Descriptor deprecated

func (*Holiday) Descriptor() ([]byte, []int)

Deprecated: Use Holiday.ProtoReflect.Descriptor instead.

func (*Holiday) GetCountryCode

func (x *Holiday) GetCountryCode() string

func (*Holiday) GetDate

func (x *Holiday) GetDate() string

func (*Holiday) GetLocalName

func (x *Holiday) GetLocalName() string

func (*Holiday) GetName

func (x *Holiday) GetName() string

func (*Holiday) GetRegions

func (x *Holiday) GetRegions() []string

func (*Holiday) GetTypes

func (x *Holiday) GetTypes() []string

func (*Holiday) ProtoMessage

func (*Holiday) ProtoMessage()

func (*Holiday) ProtoReflect

func (x *Holiday) ProtoReflect() protoreflect.Message

func (*Holiday) Reset

func (x *Holiday) Reset()

func (*Holiday) String

func (x *Holiday) String() string

type HolidaysHandler

type HolidaysHandler interface {
	Countries(context.Context, *CountriesRequest, *CountriesResponse) error
	List(context.Context, *ListRequest, *ListResponse) error
}

type HolidaysService

type HolidaysService interface {
	Countries(ctx context.Context, in *CountriesRequest, opts ...client.CallOption) (*CountriesResponse, error)
	List(ctx context.Context, in *ListRequest, opts ...client.CallOption) (*ListResponse, error)
}

func NewHolidaysService

func NewHolidaysService(name string, c client.Client) HolidaysService

type ListRequest

type ListRequest struct {

	// The 2 letter country code (as defined in ISO 3166-1 alpha-2)
	CountryCode string `protobuf:"bytes,1,opt,name=country_code,json=countryCode,proto3" json:"country_code,omitempty"`
	// The year to list holidays for
	Year int64 `protobuf:"varint,2,opt,name=year,proto3" json:"year,omitempty"`
	// contains filtered or unexported fields
}

List the holiday dates for a given country and year

func (*ListRequest) Descriptor deprecated

func (*ListRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.

func (*ListRequest) GetCountryCode

func (x *ListRequest) GetCountryCode() string

func (*ListRequest) GetYear

func (x *ListRequest) GetYear() int64

func (*ListRequest) ProtoMessage

func (*ListRequest) ProtoMessage()

func (*ListRequest) ProtoReflect

func (x *ListRequest) ProtoReflect() protoreflect.Message

func (*ListRequest) Reset

func (x *ListRequest) Reset()

func (*ListRequest) String

func (x *ListRequest) String() string

type ListResponse

type ListResponse struct {
	Holidays []*Holiday `protobuf:"bytes,1,rep,name=holidays,proto3" json:"holidays,omitempty"`
	// contains filtered or unexported fields
}

func (*ListResponse) Descriptor deprecated

func (*ListResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.

func (*ListResponse) GetHolidays

func (x *ListResponse) GetHolidays() []*Holiday

func (*ListResponse) ProtoMessage

func (*ListResponse) ProtoMessage()

func (*ListResponse) ProtoReflect

func (x *ListResponse) ProtoReflect() protoreflect.Message

func (*ListResponse) Reset

func (x *ListResponse) Reset()

func (*ListResponse) String

func (x *ListResponse) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL