showonce

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Package showonce is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	ItemStatus_name = map[int32]string{
		0: "UNKNOWN",
		1: "WAIT",
		2: "READ",
		3: "EXPIRED",
		4: "CLEARED",
	}
	ItemStatus_value = map[string]int32{
		"UNKNOWN": 0,
		"WAIT":    1,
		"READ":    2,
		"EXPIRED": 3,
		"CLEARED": 4,
	}
)

Enum value maps for ItemStatus.

View Source
var File_proto_service_proto protoreflect.FileDescriptor
View Source
var PrivateService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.showonce.v1.PrivateService",
	HandlerType: (*PrivateServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "NewItem",
			Handler:    _PrivateService_NewItem_Handler,
		},
		{
			MethodName: "GetItems",
			Handler:    _PrivateService_GetItems_Handler,
		},
		{
			MethodName: "GetStats",
			Handler:    _PrivateService_GetStats_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proto/service.proto",
}

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

View Source
var PublicService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.showonce.v1.PublicService",
	HandlerType: (*PublicServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetMetadata",
			Handler:    _PublicService_GetMetadata_Handler,
		},
		{
			MethodName: "GetData",
			Handler:    _PublicService_GetData_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proto/service.proto",
}

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

Functions

func RegisterPrivateServiceHandler

func RegisterPrivateServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterPrivateServiceHandler registers the http handlers for service PrivateService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterPrivateServiceHandlerClient

func RegisterPrivateServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PrivateServiceClient) error

RegisterPrivateServiceHandlerClient registers the http handlers for service PrivateService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PrivateServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PrivateServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "PrivateServiceClient" to call the correct interceptors.

func RegisterPrivateServiceHandlerFromEndpoint

func RegisterPrivateServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterPrivateServiceHandlerFromEndpoint is same as RegisterPrivateServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterPrivateServiceHandlerServer

func RegisterPrivateServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PrivateServiceServer) error

RegisterPrivateServiceHandlerServer registers the http handlers for service PrivateService to "mux". UnaryRPC :call PrivateServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterPrivateServiceHandlerFromEndpoint instead.

func RegisterPrivateServiceServer

func RegisterPrivateServiceServer(s grpc.ServiceRegistrar, srv PrivateServiceServer)

func RegisterPublicServiceHandler

func RegisterPublicServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterPublicServiceHandler registers the http handlers for service PublicService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterPublicServiceHandlerClient

func RegisterPublicServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PublicServiceClient) error

RegisterPublicServiceHandlerClient registers the http handlers for service PublicService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PublicServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PublicServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "PublicServiceClient" to call the correct interceptors.

func RegisterPublicServiceHandlerFromEndpoint

func RegisterPublicServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterPublicServiceHandlerFromEndpoint is same as RegisterPublicServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterPublicServiceHandlerServer

func RegisterPublicServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PublicServiceServer) error

RegisterPublicServiceHandlerServer registers the http handlers for service PublicService to "mux". UnaryRPC :call PublicServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterPublicServiceHandlerFromEndpoint instead.

func RegisterPublicServiceServer

func RegisterPublicServiceServer(s grpc.ServiceRegistrar, srv PublicServiceServer)

Types

type ItemData

type ItemData struct {
	Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // Данные секрета
	// contains filtered or unexported fields
}

Данные секрета

func (*ItemData) Descriptor deprecated

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

Deprecated: Use ItemData.ProtoReflect.Descriptor instead.

func (*ItemData) GetData

func (x *ItemData) GetData() string

func (*ItemData) ProtoMessage

func (*ItemData) ProtoMessage()

func (*ItemData) ProtoReflect

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

func (*ItemData) Reset

func (x *ItemData) Reset()

func (*ItemData) String

func (x *ItemData) String() string

func (*ItemData) Validate

func (m *ItemData) Validate() error

Validate checks the field values on ItemData with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ItemData) ValidateAll

func (m *ItemData) ValidateAll() error

ValidateAll checks the field values on ItemData with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ItemDataMultiError, or nil if none found.

type ItemDataMultiError

type ItemDataMultiError []error

ItemDataMultiError is an error wrapping multiple validation errors returned by ItemData.ValidateAll() if the designated constraints aren't met.

func (ItemDataMultiError) AllErrors

func (m ItemDataMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ItemDataMultiError) Error

func (m ItemDataMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type ItemDataValidationError

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

ItemDataValidationError is the validation error returned by ItemData.Validate if the designated constraints aren't met.

func (ItemDataValidationError) Cause

func (e ItemDataValidationError) Cause() error

Cause function returns cause value.

func (ItemDataValidationError) Error

func (e ItemDataValidationError) Error() string

Error satisfies the builtin error interface

func (ItemDataValidationError) ErrorName

func (e ItemDataValidationError) ErrorName() string

ErrorName returns error name.

func (ItemDataValidationError) Field

func (e ItemDataValidationError) Field() string

Field function returns field value.

func (ItemDataValidationError) Key

func (e ItemDataValidationError) Key() bool

Key function returns key value.

func (ItemDataValidationError) Reason

func (e ItemDataValidationError) Reason() string

Reason function returns reason value.

type ItemId

type ItemId struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

Идентификатор (ULID)

func (*ItemId) Descriptor deprecated

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

Deprecated: Use ItemId.ProtoReflect.Descriptor instead.

func (*ItemId) GetId

func (x *ItemId) GetId() string

func (*ItemId) ProtoMessage

func (*ItemId) ProtoMessage()

func (*ItemId) ProtoReflect

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

func (*ItemId) Reset

func (x *ItemId) Reset()

func (*ItemId) String

func (x *ItemId) String() string

func (*ItemId) Validate

func (m *ItemId) Validate() error

Validate checks the field values on ItemId with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ItemId) ValidateAll

func (m *ItemId) ValidateAll() error

ValidateAll checks the field values on ItemId with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ItemIdMultiError, or nil if none found.

type ItemIdMultiError

type ItemIdMultiError []error

ItemIdMultiError is an error wrapping multiple validation errors returned by ItemId.ValidateAll() if the designated constraints aren't met.

func (ItemIdMultiError) AllErrors

func (m ItemIdMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ItemIdMultiError) Error

func (m ItemIdMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type ItemIdValidationError

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

ItemIdValidationError is the validation error returned by ItemId.Validate if the designated constraints aren't met.

func (ItemIdValidationError) Cause

func (e ItemIdValidationError) Cause() error

Cause function returns cause value.

func (ItemIdValidationError) Error

func (e ItemIdValidationError) Error() string

Error satisfies the builtin error interface

func (ItemIdValidationError) ErrorName

func (e ItemIdValidationError) ErrorName() string

ErrorName returns error name.

func (ItemIdValidationError) Field

func (e ItemIdValidationError) Field() string

Field function returns field value.

func (ItemIdValidationError) Key

func (e ItemIdValidationError) Key() bool

Key function returns key value.

func (ItemIdValidationError) Reason

func (e ItemIdValidationError) Reason() string

Reason function returns reason value.

type ItemList

type ItemList struct {
	Items []*ItemMetaWithId `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` // Список секретов
	// contains filtered or unexported fields
}

Список секретов

func (*ItemList) Descriptor deprecated

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

Deprecated: Use ItemList.ProtoReflect.Descriptor instead.

func (*ItemList) GetItems

func (x *ItemList) GetItems() []*ItemMetaWithId

func (*ItemList) ProtoMessage

func (*ItemList) ProtoMessage()

func (*ItemList) ProtoReflect

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

func (*ItemList) Reset

func (x *ItemList) Reset()

func (*ItemList) String

func (x *ItemList) String() string

func (*ItemList) Validate

func (m *ItemList) Validate() error

Validate checks the field values on ItemList with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ItemList) ValidateAll

func (m *ItemList) ValidateAll() error

ValidateAll checks the field values on ItemList with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ItemListMultiError, or nil if none found.

type ItemListMultiError

type ItemListMultiError []error

ItemListMultiError is an error wrapping multiple validation errors returned by ItemList.ValidateAll() if the designated constraints aren't met.

func (ItemListMultiError) AllErrors

func (m ItemListMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ItemListMultiError) Error

func (m ItemListMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type ItemListValidationError

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

ItemListValidationError is the validation error returned by ItemList.Validate if the designated constraints aren't met.

func (ItemListValidationError) Cause

func (e ItemListValidationError) Cause() error

Cause function returns cause value.

func (ItemListValidationError) Error

func (e ItemListValidationError) Error() string

Error satisfies the builtin error interface

func (ItemListValidationError) ErrorName

func (e ItemListValidationError) ErrorName() string

ErrorName returns error name.

func (ItemListValidationError) Field

func (e ItemListValidationError) Field() string

Field function returns field value.

func (ItemListValidationError) Key

func (e ItemListValidationError) Key() bool

Key function returns key value.

func (ItemListValidationError) Reason

func (e ItemListValidationError) Reason() string

Reason function returns reason value.

type ItemMeta

type ItemMeta struct {
	Title      string                 `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`                                    // описание
	Group      string                 `protobuf:"bytes,2,opt,name=group,proto3" json:"group,omitempty"`                                    // идентификатор для группировки
	Owner      string                 `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"`                                    // автор
	Status     ItemStatus             `protobuf:"varint,4,opt,name=status,proto3,enum=api.showonce.v1.ItemStatus" json:"status,omitempty"` // статус
	CreatedAt  *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`           // момент создания
	ModifiedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=modified_at,json=modifiedAt,proto3" json:"modified_at,omitempty"`        // первоначально - срок автоудаления, после показа - момент показа
	// contains filtered or unexported fields
}

Метаданные секрета

func (*ItemMeta) Descriptor deprecated

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

Deprecated: Use ItemMeta.ProtoReflect.Descriptor instead.

func (*ItemMeta) GetCreatedAt

func (x *ItemMeta) GetCreatedAt() *timestamppb.Timestamp

func (*ItemMeta) GetGroup

func (x *ItemMeta) GetGroup() string

func (*ItemMeta) GetModifiedAt

func (x *ItemMeta) GetModifiedAt() *timestamppb.Timestamp

func (*ItemMeta) GetOwner

func (x *ItemMeta) GetOwner() string

func (*ItemMeta) GetStatus

func (x *ItemMeta) GetStatus() ItemStatus

func (*ItemMeta) GetTitle

func (x *ItemMeta) GetTitle() string

func (*ItemMeta) ProtoMessage

func (*ItemMeta) ProtoMessage()

func (*ItemMeta) ProtoReflect

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

func (*ItemMeta) Reset

func (x *ItemMeta) Reset()

func (*ItemMeta) String

func (x *ItemMeta) String() string

func (*ItemMeta) Validate

func (m *ItemMeta) Validate() error

Validate checks the field values on ItemMeta with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ItemMeta) ValidateAll

func (m *ItemMeta) ValidateAll() error

ValidateAll checks the field values on ItemMeta with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ItemMetaMultiError, or nil if none found.

type ItemMetaMultiError

type ItemMetaMultiError []error

ItemMetaMultiError is an error wrapping multiple validation errors returned by ItemMeta.ValidateAll() if the designated constraints aren't met.

func (ItemMetaMultiError) AllErrors

func (m ItemMetaMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ItemMetaMultiError) Error

func (m ItemMetaMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type ItemMetaValidationError

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

ItemMetaValidationError is the validation error returned by ItemMeta.Validate if the designated constraints aren't met.

func (ItemMetaValidationError) Cause

func (e ItemMetaValidationError) Cause() error

Cause function returns cause value.

func (ItemMetaValidationError) Error

func (e ItemMetaValidationError) Error() string

Error satisfies the builtin error interface

func (ItemMetaValidationError) ErrorName

func (e ItemMetaValidationError) ErrorName() string

ErrorName returns error name.

func (ItemMetaValidationError) Field

func (e ItemMetaValidationError) Field() string

Field function returns field value.

func (ItemMetaValidationError) Key

func (e ItemMetaValidationError) Key() bool

Key function returns key value.

func (ItemMetaValidationError) Reason

func (e ItemMetaValidationError) Reason() string

Reason function returns reason value.

type ItemMetaWithId

type ItemMetaWithId struct {
	Id   string    `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`     // идентификатор
	Meta *ItemMeta `protobuf:"bytes,2,opt,name=meta,proto3" json:"meta,omitempty"` // метаданные
	// contains filtered or unexported fields
}

Метаданные секрета с идентификатором

func (*ItemMetaWithId) Descriptor deprecated

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

Deprecated: Use ItemMetaWithId.ProtoReflect.Descriptor instead.

func (*ItemMetaWithId) GetId

func (x *ItemMetaWithId) GetId() string

func (*ItemMetaWithId) GetMeta

func (x *ItemMetaWithId) GetMeta() *ItemMeta

func (*ItemMetaWithId) ProtoMessage

func (*ItemMetaWithId) ProtoMessage()

func (*ItemMetaWithId) ProtoReflect

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

func (*ItemMetaWithId) Reset

func (x *ItemMetaWithId) Reset()

func (*ItemMetaWithId) String

func (x *ItemMetaWithId) String() string

func (*ItemMetaWithId) Validate

func (m *ItemMetaWithId) Validate() error

Validate checks the field values on ItemMetaWithId with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ItemMetaWithId) ValidateAll

func (m *ItemMetaWithId) ValidateAll() error

ValidateAll checks the field values on ItemMetaWithId with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ItemMetaWithIdMultiError, or nil if none found.

type ItemMetaWithIdMultiError

type ItemMetaWithIdMultiError []error

ItemMetaWithIdMultiError is an error wrapping multiple validation errors returned by ItemMetaWithId.ValidateAll() if the designated constraints aren't met.

func (ItemMetaWithIdMultiError) AllErrors

func (m ItemMetaWithIdMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ItemMetaWithIdMultiError) Error

func (m ItemMetaWithIdMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type ItemMetaWithIdValidationError

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

ItemMetaWithIdValidationError is the validation error returned by ItemMetaWithId.Validate if the designated constraints aren't met.

func (ItemMetaWithIdValidationError) Cause

Cause function returns cause value.

func (ItemMetaWithIdValidationError) Error

Error satisfies the builtin error interface

func (ItemMetaWithIdValidationError) ErrorName

func (e ItemMetaWithIdValidationError) ErrorName() string

ErrorName returns error name.

func (ItemMetaWithIdValidationError) Field

Field function returns field value.

func (ItemMetaWithIdValidationError) Key

Key function returns key value.

func (ItemMetaWithIdValidationError) Reason

Reason function returns reason value.

type ItemStatus

type ItemStatus int32

Статус секрета

const (
	// A Standard tournament
	ItemStatus_UNKNOWN ItemStatus = 0
	// Готово к прочтению
	ItemStatus_WAIT ItemStatus = 1
	// Прочитано
	ItemStatus_READ ItemStatus = 2
	// Истек срок актуальности
	ItemStatus_EXPIRED ItemStatus = 3
	// Удалено
	ItemStatus_CLEARED ItemStatus = 4
)

func (ItemStatus) Descriptor

func (ItemStatus) Descriptor() protoreflect.EnumDescriptor

func (ItemStatus) Enum

func (x ItemStatus) Enum() *ItemStatus

func (ItemStatus) EnumDescriptor deprecated

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

Deprecated: Use ItemStatus.Descriptor instead.

func (ItemStatus) Number

func (x ItemStatus) Number() protoreflect.EnumNumber

func (ItemStatus) String

func (x ItemStatus) String() string

func (ItemStatus) Type

type NewItemRequest

type NewItemRequest struct {
	Title      string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`                             // описание
	Group      string `protobuf:"bytes,2,opt,name=group,proto3" json:"group,omitempty"`                             // идентификатор для группировки
	Expire     string `protobuf:"bytes,3,opt,name=expire,proto3" json:"expire,omitempty"`                           // срок актуальности
	ExpireUnit string `protobuf:"bytes,4,opt,name=expire_unit,json=expireUnit,proto3" json:"expire_unit,omitempty"` // единица срока актуальности ("d" - день, остальные варианты - как в go: "ns", "us" (or "µs"), "ms", "s", "m", "h")
	Data       string `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"`                               // текст секрета, удаляется после первого показа
	// contains filtered or unexported fields
}

Аргументы запроса на создание

func (*NewItemRequest) Descriptor deprecated

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

Deprecated: Use NewItemRequest.ProtoReflect.Descriptor instead.

func (*NewItemRequest) GetData

func (x *NewItemRequest) GetData() string

func (*NewItemRequest) GetExpire

func (x *NewItemRequest) GetExpire() string

func (*NewItemRequest) GetExpireUnit

func (x *NewItemRequest) GetExpireUnit() string

func (*NewItemRequest) GetGroup

func (x *NewItemRequest) GetGroup() string

func (*NewItemRequest) GetTitle

func (x *NewItemRequest) GetTitle() string

func (*NewItemRequest) ProtoMessage

func (*NewItemRequest) ProtoMessage()

func (*NewItemRequest) ProtoReflect

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

func (*NewItemRequest) Reset

func (x *NewItemRequest) Reset()

func (*NewItemRequest) String

func (x *NewItemRequest) String() string

func (*NewItemRequest) Validate

func (m *NewItemRequest) Validate() error

Validate checks the field values on NewItemRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*NewItemRequest) ValidateAll

func (m *NewItemRequest) ValidateAll() error

ValidateAll checks the field values on NewItemRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in NewItemRequestMultiError, or nil if none found.

type NewItemRequestMultiError

type NewItemRequestMultiError []error

NewItemRequestMultiError is an error wrapping multiple validation errors returned by NewItemRequest.ValidateAll() if the designated constraints aren't met.

func (NewItemRequestMultiError) AllErrors

func (m NewItemRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (NewItemRequestMultiError) Error

func (m NewItemRequestMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type NewItemRequestValidationError

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

NewItemRequestValidationError is the validation error returned by NewItemRequest.Validate if the designated constraints aren't met.

func (NewItemRequestValidationError) Cause

Cause function returns cause value.

func (NewItemRequestValidationError) Error

Error satisfies the builtin error interface

func (NewItemRequestValidationError) ErrorName

func (e NewItemRequestValidationError) ErrorName() string

ErrorName returns error name.

func (NewItemRequestValidationError) Field

Field function returns field value.

func (NewItemRequestValidationError) Key

Key function returns key value.

func (NewItemRequestValidationError) Reason

Reason function returns reason value.

type PrivateServiceClient

type PrivateServiceClient interface {
	// создать секрет
	NewItem(ctx context.Context, in *NewItemRequest, opts ...grpc.CallOption) (*ItemId, error)
	// вернуть список своих секретов
	GetItems(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ItemList, error)
	// общая статистика по количеству секретов
	GetStats(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*StatsResponse, error)
}

PrivateServiceClient is the client API for PrivateService 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 PrivateServiceServer

type PrivateServiceServer interface {
	// создать секрет
	NewItem(context.Context, *NewItemRequest) (*ItemId, error)
	// вернуть список своих секретов
	GetItems(context.Context, *emptypb.Empty) (*ItemList, error)
	// общая статистика по количеству секретов
	GetStats(context.Context, *emptypb.Empty) (*StatsResponse, error)
	// contains filtered or unexported methods
}

PrivateServiceServer is the server API for PrivateService service. All implementations must embed UnimplementedPrivateServiceServer for forward compatibility

type PublicServiceClient

type PublicServiceClient interface {
	// вернуть метаданные секрета по id
	GetMetadata(ctx context.Context, in *ItemId, opts ...grpc.CallOption) (*ItemMeta, error)
	// вернуть текст секрета по id
	GetData(ctx context.Context, in *ItemId, opts ...grpc.CallOption) (*ItemData, error)
}

PublicServiceClient is the client API for PublicService 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 PublicServiceServer

type PublicServiceServer interface {
	// вернуть метаданные секрета по id
	GetMetadata(context.Context, *ItemId) (*ItemMeta, error)
	// вернуть текст секрета по id
	GetData(context.Context, *ItemId) (*ItemData, error)
	// contains filtered or unexported methods
}

PublicServiceServer is the server API for PublicService service. All implementations must embed UnimplementedPublicServiceServer for forward compatibility

type Stats

type Stats struct {
	Total   int32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`     // Всего в хранилище
	Wait    int32 `protobuf:"varint,2,opt,name=wait,proto3" json:"wait,omitempty"`       // Готово к прочтению
	Read    int32 `protobuf:"varint,3,opt,name=read,proto3" json:"read,omitempty"`       // Прочитано
	Expired int32 `protobuf:"varint,4,opt,name=expired,proto3" json:"expired,omitempty"` // Истек срок актуальности
	// contains filtered or unexported fields
}

Статистика по секретам

func (*Stats) Descriptor deprecated

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

Deprecated: Use Stats.ProtoReflect.Descriptor instead.

func (*Stats) GetExpired

func (x *Stats) GetExpired() int32

func (*Stats) GetRead

func (x *Stats) GetRead() int32

func (*Stats) GetTotal

func (x *Stats) GetTotal() int32

func (*Stats) GetWait

func (x *Stats) GetWait() int32

func (*Stats) ProtoMessage

func (*Stats) ProtoMessage()

func (*Stats) ProtoReflect

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

func (*Stats) Reset

func (x *Stats) Reset()

func (*Stats) String

func (x *Stats) String() string

func (*Stats) Validate

func (m *Stats) Validate() error

Validate checks the field values on Stats with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Stats) ValidateAll

func (m *Stats) ValidateAll() error

ValidateAll checks the field values on Stats with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in StatsMultiError, or nil if none found.

type StatsMultiError

type StatsMultiError []error

StatsMultiError is an error wrapping multiple validation errors returned by Stats.ValidateAll() if the designated constraints aren't met.

func (StatsMultiError) AllErrors

func (m StatsMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (StatsMultiError) Error

func (m StatsMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type StatsResponse

type StatsResponse struct {
	My    *Stats `protobuf:"bytes,1,opt,name=my,proto3" json:"my,omitempty"`       // Данные по текущему пользователю
	Other *Stats `protobuf:"bytes,2,opt,name=other,proto3" json:"other,omitempty"` // Данные по остальным пользователям
	// contains filtered or unexported fields
}

Ответ на запрос статистика

func (*StatsResponse) Descriptor deprecated

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

Deprecated: Use StatsResponse.ProtoReflect.Descriptor instead.

func (*StatsResponse) GetMy

func (x *StatsResponse) GetMy() *Stats

func (*StatsResponse) GetOther

func (x *StatsResponse) GetOther() *Stats

func (*StatsResponse) ProtoMessage

func (*StatsResponse) ProtoMessage()

func (*StatsResponse) ProtoReflect

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

func (*StatsResponse) Reset

func (x *StatsResponse) Reset()

func (*StatsResponse) String

func (x *StatsResponse) String() string

func (*StatsResponse) Validate

func (m *StatsResponse) Validate() error

Validate checks the field values on StatsResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*StatsResponse) ValidateAll

func (m *StatsResponse) ValidateAll() error

ValidateAll checks the field values on StatsResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in StatsResponseMultiError, or nil if none found.

type StatsResponseMultiError

type StatsResponseMultiError []error

StatsResponseMultiError is an error wrapping multiple validation errors returned by StatsResponse.ValidateAll() if the designated constraints aren't met.

func (StatsResponseMultiError) AllErrors

func (m StatsResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (StatsResponseMultiError) Error

func (m StatsResponseMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type StatsResponseValidationError

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

StatsResponseValidationError is the validation error returned by StatsResponse.Validate if the designated constraints aren't met.

func (StatsResponseValidationError) Cause

Cause function returns cause value.

func (StatsResponseValidationError) Error

Error satisfies the builtin error interface

func (StatsResponseValidationError) ErrorName

func (e StatsResponseValidationError) ErrorName() string

ErrorName returns error name.

func (StatsResponseValidationError) Field

Field function returns field value.

func (StatsResponseValidationError) Key

Key function returns key value.

func (StatsResponseValidationError) Reason

Reason function returns reason value.

type StatsValidationError

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

StatsValidationError is the validation error returned by Stats.Validate if the designated constraints aren't met.

func (StatsValidationError) Cause

func (e StatsValidationError) Cause() error

Cause function returns cause value.

func (StatsValidationError) Error

func (e StatsValidationError) Error() string

Error satisfies the builtin error interface

func (StatsValidationError) ErrorName

func (e StatsValidationError) ErrorName() string

ErrorName returns error name.

func (StatsValidationError) Field

func (e StatsValidationError) Field() string

Field function returns field value.

func (StatsValidationError) Key

func (e StatsValidationError) Key() bool

Key function returns key value.

func (StatsValidationError) Reason

func (e StatsValidationError) Reason() string

Reason function returns reason value.

type UnimplementedPrivateServiceServer

type UnimplementedPrivateServiceServer struct {
}

UnimplementedPrivateServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedPrivateServiceServer) GetItems

func (UnimplementedPrivateServiceServer) GetStats

func (UnimplementedPrivateServiceServer) NewItem added in v1.0.3

type UnimplementedPublicServiceServer

type UnimplementedPublicServiceServer struct {
}

UnimplementedPublicServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedPublicServiceServer) GetData

func (UnimplementedPublicServiceServer) GetMetadata

type UnsafePrivateServiceServer

type UnsafePrivateServiceServer interface {
	// contains filtered or unexported methods
}

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

type UnsafePublicServiceServer

type UnsafePublicServiceServer interface {
	// contains filtered or unexported methods
}

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

Jump to

Keyboard shortcuts

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