protobuf

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_pagination_proto protoreflect.FileDescriptor
View Source
var File_registry_proto protoreflect.FileDescriptor
View Source
var File_tracing_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Pagination

type Pagination struct {
	Current  int32  `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"`
	PageSize int32  `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	Total    int32  `protobuf:"varint,3,opt,name=total,proto3" json:"total,omitempty"`
	RawTotal *int64 `protobuf:"varint,4,opt,name=raw_total,json=rawTotal,proto3,oneof" json:"raw_total,omitempty"`
	// contains filtered or unexported fields
}

通用的分页信息

func PageWrap

func PageWrap(p *Pagination) *Pagination

func (*Pagination) Count

func (p *Pagination) Count() *int64

Count 返回分页查询的总记录数 int64 指针

func (*Pagination) Descriptor deprecated

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

Deprecated: Use Pagination.ProtoReflect.Descriptor instead.

func (*Pagination) GetCurrent

func (x *Pagination) GetCurrent() int32

func (*Pagination) GetPageSize

func (x *Pagination) GetPageSize() int32

func (*Pagination) GetRawTotal

func (x *Pagination) GetRawTotal() int64

func (*Pagination) GetTotal

func (x *Pagination) GetTotal() int32

func (*Pagination) Limit

func (p *Pagination) Limit() int

Limit 返回分页查询的限制数, 是 PageSize 的别名

func (*Pagination) Offset

func (p *Pagination) Offset() int

Offset 返回分页查询的偏移量, 已自动处理分页数。 min:1, max:unlimited

func (*Pagination) Paginate

func (p *Pagination) Paginate() func(db *gorm.DB) *gorm.DB

func (*Pagination) ProtoMessage

func (*Pagination) ProtoMessage()

func (*Pagination) ProtoReflect

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

func (*Pagination) Reset

func (x *Pagination) Reset()

func (*Pagination) Resp

func (p *Pagination) Resp() *Pagination

func (*Pagination) String

func (x *Pagination) String() string

type Registry

type Registry struct {

	// 是否启用服务注册
	Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"`
	// 是否只作为服务发现,不自注册
	OnlyDiscovery bool `protobuf:"varint,2,opt,name=only_discovery,json=onlyDiscovery,proto3" json:"only_discovery,omitempty"`
	// 服务注册中心地址
	Endpoints []string `protobuf:"bytes,3,rep,name=endpoints,proto3" json:"endpoints,omitempty"`
	// 服务命名空间
	Namespace string `protobuf:"bytes,4,opt,name=namespace,proto3" json:"namespace,omitempty"`
	// contains filtered or unexported fields
}

func (*Registry) Descriptor deprecated

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

Deprecated: Use Registry.ProtoReflect.Descriptor instead.

func (*Registry) GetEnabled

func (x *Registry) GetEnabled() bool

func (*Registry) GetEndpoints

func (x *Registry) GetEndpoints() []string

func (*Registry) GetNamespace

func (x *Registry) GetNamespace() string

func (*Registry) GetOnlyDiscovery

func (x *Registry) GetOnlyDiscovery() bool

func (*Registry) ProtoMessage

func (*Registry) ProtoMessage()

func (*Registry) ProtoReflect

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

func (*Registry) Reset

func (x *Registry) Reset()

func (*Registry) String

func (x *Registry) String() string

type Tracing

type Tracing struct {

	// 链路上报服务入口
	Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"`
	// 服务名称
	CustomName string `protobuf:"bytes,3,opt,name=custom_name,json=customName,proto3" json:"custom_name,omitempty"`
	// contains filtered or unexported fields
}

func (*Tracing) Descriptor deprecated

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

Deprecated: Use Tracing.ProtoReflect.Descriptor instead.

func (*Tracing) GetCustomName

func (x *Tracing) GetCustomName() string

func (*Tracing) GetEndpoint

func (x *Tracing) GetEndpoint() string

func (*Tracing) ProtoMessage

func (*Tracing) ProtoMessage()

func (*Tracing) ProtoReflect

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

func (*Tracing) Reset

func (x *Tracing) Reset()

func (*Tracing) String

func (x *Tracing) String() string

Jump to

Keyboard shortcuts

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