Skip to content

Locale Go-API

import "givc/modules/api/locale"

const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

const (
LocaleClient_LocaleSet_FullMethodName = "/locale.LocaleClient/LocaleSet"
LocaleClient_TimezoneSet_FullMethodName = "/locale.LocaleClient/TimezoneSet"
)

This is a compile-time assertion to ensure that this generated file is compatible with the grpc package it is being compiled against. Requires gRPC-Go v1.64.0 or later.

const _ = grpc.SupportPackageIsVersion9

const file_locale_locale_proto_rawDesc = "" +
"\n" +
"\x13locale/locale.proto\x12\x06locale\"R\n" +
"\x10LocaleAssignment\x12(\n" +
"\x03key\x18\x01 \x01(\x0e2\x16.locale.LocaleMacroKeyR\x03key\x12\x14\n" +
"\x05value\x18\x02 \x01(\tR\x05value\"K\n" +
"\rLocaleMessage\x12:\n" +
"\vassignments\x18\x01 \x03(\v2\x18.locale.LocaleAssignmentR\vassignments\"-\n" +
"\x0fTimezoneMessage\x12\x1a\n" +
"\bTimezone\x18\x01 \x01(\tR\bTimezone\"\a\n" +
"\x05Empty*\xeb\x01\n" +
"\x0eLocaleMacroKey\x12\b\n" +
"\x04LANG\x10\x00\x12\x0e\n" +
"\n" +
"LC_ADDRESS\x10\x01\x12\x0e\n" +
"\n" +
"LC_COLLATE\x10\x02\x12\f\n" +
"\bLC_CTYPE\x10\x03\x12\x15\n" +
"\x11LC_IDENTIFICATION\x10\x04\x12\x0f\n" +
"\vLC_MONETARY\x10\x05\x12\x0f\n" +
"\vLC_MESSAGES\x10\x06\x12\x12\n" +
"\x0eLC_MEASUREMENT\x10\a\x12\v\n" +
"\aLC_NAME\x10\b\x12\x0e\n" +
"\n" +
"LC_NUMERIC\x10\t\x12\f\n" +
"\bLC_PAPER\x10\n" +
"\x12\x10\n" +
"\fLC_TELEPHONE\x10\v\x12\v\n" +
"\aLC_TIME\x10\f\x12\n" +
"\n" +
"\x06LC_ALL\x10\r2|\n" +
"\fLocaleClient\x123\n" +
"\tLocaleSet\x12\x15.locale.LocaleMessage\x1a\r.locale.Empty\"\x00\x127\n" +
"\vTimezoneSet\x12\x17.locale.TimezoneMessage\x1a\r.locale.Empty\"\x00B\x19Z\x17givc/modules/api/localeb\x06proto3"

Enum value maps for LocaleMacroKey.

var (
LocaleMacroKey_name = map[int32]string{
0: "LANG",
1: "LC_ADDRESS",
2: "LC_COLLATE",
3: "LC_CTYPE",
4: "LC_IDENTIFICATION",
5: "LC_MONETARY",
6: "LC_MESSAGES",
7: "LC_MEASUREMENT",
8: "LC_NAME",
9: "LC_NUMERIC",
10: "LC_PAPER",
11: "LC_TELEPHONE",
12: "LC_TIME",
13: "LC_ALL",
}
LocaleMacroKey_value = map[string]int32{
"LANG": 0,
"LC_ADDRESS": 1,
"LC_COLLATE": 2,
"LC_CTYPE": 3,
"LC_IDENTIFICATION": 4,
"LC_MONETARY": 5,
"LC_MESSAGES": 6,
"LC_MEASUREMENT": 7,
"LC_NAME": 8,
"LC_NUMERIC": 9,
"LC_PAPER": 10,
"LC_TELEPHONE": 11,
"LC_TIME": 12,
"LC_ALL": 13,
}
)

var (
file_locale_locale_proto_rawDescOnce sync.Once
file_locale_locale_proto_rawDescData []byte
)

var File_locale_locale_proto protoreflect.FileDescriptor

LocaleClient_ServiceDesc is the grpc.ServiceDesc for LocaleClient service. It’s only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

var LocaleClient_ServiceDesc = grpc.ServiceDesc{
ServiceName: "locale.LocaleClient",
HandlerType: (*LocaleClientServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "LocaleSet",
Handler: _LocaleClient_LocaleSet_Handler,
},
{
MethodName: "TimezoneSet",
Handler: _LocaleClient_TimezoneSet_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "locale/locale.proto",
}

var file_locale_locale_proto_depIdxs = []int32{
0,
1,
2,
3,
4,
4,
4,
2,
2,
2,
0,
}

var file_locale_locale_proto_enumTypes = make([]protoimpl.EnumInfo, 1)

var file_locale_locale_proto_goTypes = []any{
(LocaleMacroKey)(0),
(*LocaleAssignment)(nil),
(*LocaleMessage)(nil),
(*TimezoneMessage)(nil),
(*Empty)(nil),
}

var file_locale_locale_proto_msgTypes = make([]protoimpl.MessageInfo, 4)

func RegisterLocaleClientServer(s grpc.ServiceRegistrar, srv LocaleClientServer)

func _LocaleClient_LocaleSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error)

func _LocaleClient_TimezoneSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error)

func file_locale_locale_proto_init()

func file_locale_locale_proto_rawDescGZIP() []byte

func init()

Empty message

type Empty struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}

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

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage()

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

func (x *Empty) Reset()

func (x *Empty) String() string

type LocaleAssignment struct {
state protoimpl.MessageState `protogen:"open.v1"`
Key LocaleMacroKey `protobuf:"varint,1,opt,name=key,proto3,enum=locale.LocaleMacroKey" json:"key,omitempty"` // e.g., LC_TIME, LC_NUMERIC
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // e.g., en_US.UTF-8
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}

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

Deprecated: Use LocaleAssignment.ProtoReflect.Descriptor instead.

func (x *LocaleAssignment) GetKey() LocaleMacroKey

func (x *LocaleAssignment) GetValue() string

func (*LocaleAssignment) ProtoMessage()

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

func (x *LocaleAssignment) Reset()

func (x *LocaleAssignment) String() string

LocaleClientClient is the client API for LocaleClient service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type LocaleClientClient interface {
// System-wide locale broadcast
LocaleSet(ctx context.Context, in *LocaleMessage, opts ...grpc.CallOption) (*Empty, error)
// System-wide timezone broadcast
TimezoneSet(ctx context.Context, in *TimezoneMessage, opts ...grpc.CallOption) (*Empty, error)
}

func NewLocaleClientClient(cc grpc.ClientConnInterface) LocaleClientClient

LocaleClientServer is the server API for LocaleClient service. All implementations must embed UnimplementedLocaleClientServer for forward compatibility.

type LocaleClientServer interface {
// System-wide locale broadcast
LocaleSet(context.Context, *LocaleMessage) (*Empty, error)
// System-wide timezone broadcast
TimezoneSet(context.Context, *TimezoneMessage) (*Empty, error)
mustEmbedUnimplementedLocaleClientServer()
}

Locale macros as defined in [locale(7)](https://man7.org/linux/man-pages/man7/locale.7.html\)

type LocaleMacroKey int32

const (
LocaleMacroKey_LANG LocaleMacroKey = 0
LocaleMacroKey_LC_ADDRESS LocaleMacroKey = 1
LocaleMacroKey_LC_COLLATE LocaleMacroKey = 2
LocaleMacroKey_LC_CTYPE LocaleMacroKey = 3
LocaleMacroKey_LC_IDENTIFICATION LocaleMacroKey = 4
LocaleMacroKey_LC_MONETARY LocaleMacroKey = 5
LocaleMacroKey_LC_MESSAGES LocaleMacroKey = 6
LocaleMacroKey_LC_MEASUREMENT LocaleMacroKey = 7
LocaleMacroKey_LC_NAME LocaleMacroKey = 8
LocaleMacroKey_LC_NUMERIC LocaleMacroKey = 9
LocaleMacroKey_LC_PAPER LocaleMacroKey = 10
LocaleMacroKey_LC_TELEPHONE LocaleMacroKey = 11
LocaleMacroKey_LC_TIME LocaleMacroKey = 12
LocaleMacroKey_LC_ALL LocaleMacroKey = 13
)

func (LocaleMacroKey) Descriptor() protoreflect.EnumDescriptor

func (x LocaleMacroKey) Enum() *LocaleMacroKey

func (LocaleMacroKey) EnumDescriptor() ([]byte, []int)

Deprecated: Use LocaleMacroKey.Descriptor instead.

func (x LocaleMacroKey) Number() protoreflect.EnumNumber

func (x LocaleMacroKey) String() string

func (LocaleMacroKey) Type() protoreflect.EnumType

type LocaleMessage struct {
state protoimpl.MessageState `protogen:"open.v1"`
Assignments []*LocaleAssignment `protobuf:"bytes,1,rep,name=assignments,proto3" json:"assignments,omitempty"` // List of locale assignments
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}

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

Deprecated: Use LocaleMessage.ProtoReflect.Descriptor instead.

func (x *LocaleMessage) GetAssignments() []*LocaleAssignment

func (*LocaleMessage) ProtoMessage()

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

func (x *LocaleMessage) Reset()

func (x *LocaleMessage) String() string

type TimezoneMessage struct {
state protoimpl.MessageState `protogen:"open.v1"`
Timezone string `protobuf:"bytes,1,opt,name=Timezone,proto3" json:"Timezone,omitempty"` // String with timezone value. Format: [tz database](https://en.wikipedia.org/wiki/Tz_database) name, usually Area/City or Etc/GMT+3.
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}

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

Deprecated: Use TimezoneMessage.ProtoReflect.Descriptor instead.

func (x *TimezoneMessage) GetTimezone() string

func (*TimezoneMessage) ProtoMessage()

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

func (x *TimezoneMessage) Reset()

func (x *TimezoneMessage) String() string

UnimplementedLocaleClientServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

type UnimplementedLocaleClientServer struct{}

func (UnimplementedLocaleClientServer) LocaleSet

Section titled “func (UnimplementedLocaleClientServer) LocaleSet”
func (UnimplementedLocaleClientServer) LocaleSet(context.Context, *LocaleMessage) (*Empty, error)

func (UnimplementedLocaleClientServer) TimezoneSet

Section titled “func (UnimplementedLocaleClientServer) TimezoneSet”
func (UnimplementedLocaleClientServer) TimezoneSet(context.Context, *TimezoneMessage) (*Empty, error)

func (UnimplementedLocaleClientServer) mustEmbedUnimplementedLocaleClientServer

Section titled “func (UnimplementedLocaleClientServer) mustEmbedUnimplementedLocaleClientServer”
func (UnimplementedLocaleClientServer) mustEmbedUnimplementedLocaleClientServer()

func (UnimplementedLocaleClientServer) testEmbeddedByValue

Section titled “func (UnimplementedLocaleClientServer) testEmbeddedByValue”
func (UnimplementedLocaleClientServer) testEmbeddedByValue()

UnsafeLocaleClientServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to LocaleClientServer will result in compilation errors.

type UnsafeLocaleClientServer interface {
mustEmbedUnimplementedLocaleClientServer()
}

type localeClientClient struct {
cc grpc.ClientConnInterface
}

func (c *localeClientClient) LocaleSet(ctx context.Context, in *LocaleMessage, opts ...grpc.CallOption) (*Empty, error)

func (c *localeClientClient) TimezoneSet(ctx context.Context, in *TimezoneMessage, opts ...grpc.CallOption) (*Empty, error)

Generated by gomarkdoc