mconf

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Type_name = map[int32]string{
		0: "GLOBAL",
		1: "PRIVATE",
	}
	Type_value = map[string]int32{
		"GLOBAL":  0,
		"PRIVATE": 1,
	}
)

Enum value maps for Type.

View Source
var File_pkg_mconf_pb_conf_proto protoreflect.FileDescriptor
View Source
var File_pkg_mconf_pb_enum_proto protoreflect.FileDescriptor
View Source
var File_pkg_mconf_pb_request_proto protoreflect.FileDescriptor
View Source
var File_pkg_mconf_pb_service_proto protoreflect.FileDescriptor
View Source
var MicroConfigService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "keyauth.mconf.MicroConfigService",
	HandlerType: (*MicroConfigServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateGroup",
			Handler:    _MicroConfigService_CreateGroup_Handler,
		},
		{
			MethodName: "QueryGroup",
			Handler:    _MicroConfigService_QueryGroup_Handler,
		},
		{
			MethodName: "DeleteGroup",
			Handler:    _MicroConfigService_DeleteGroup_Handler,
		},
		{
			MethodName: "QueryItem",
			Handler:    _MicroConfigService_QueryItem_Handler,
		},
		{
			MethodName: "AddItemToGroup",
			Handler:    _MicroConfigService_AddItemToGroup_Handler,
		},
		{
			MethodName: "RemoveItemFromGroup",
			Handler:    _MicroConfigService_RemoveItemFromGroup_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "pkg/mconf/pb/service.proto",
}

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

Functions

func HttpEntry

func HttpEntry() *http.EntrySet

HttpEntry todo

func RegisterMicroConfigServiceServer

func RegisterMicroConfigServiceServer(s grpc.ServiceRegistrar, srv MicroConfigServiceServer)

Types

type AddItemToGroupRequest

type AddItemToGroupRequest struct {
	GroupName string         `protobuf:"bytes,1,opt,name=group_name,json=groupName,proto3" json:"group_name"`
	Items     []*ItemRequest `protobuf:"bytes,2,rep,name=items,proto3" json:"items" bson:"items"`
	// contains filtered or unexported fields
}

AddItemToGroupRequest todo

func NewAddItemToGroupRequest

func NewAddItemToGroupRequest() *AddItemToGroupRequest

NewAddItemToGroupRequest todo

func (*AddItemToGroupRequest) Descriptor deprecated

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

Deprecated: Use AddItemToGroupRequest.ProtoReflect.Descriptor instead.

func (*AddItemToGroupRequest) GetGroupName

func (x *AddItemToGroupRequest) GetGroupName() string

func (*AddItemToGroupRequest) GetItems

func (x *AddItemToGroupRequest) GetItems() []*ItemRequest

func (*AddItemToGroupRequest) ProtoMessage

func (*AddItemToGroupRequest) ProtoMessage()

func (*AddItemToGroupRequest) ProtoReflect

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

func (*AddItemToGroupRequest) Reset

func (x *AddItemToGroupRequest) Reset()

func (*AddItemToGroupRequest) String

func (x *AddItemToGroupRequest) String() string

type CreateGroupRequest

type CreateGroupRequest struct {

	// 组类型
	Type Type `protobuf:"varint,1,opt,name=type,proto3,enum=keyauth.mconf.Type" json:"type"`
	// 名称
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name" validate:"required,lte=200"`
	// 描述信息
	Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	// contains filtered or unexported fields
}

CreateGroupRequest 服务组请求

func NewCreateGroupRequest

func NewCreateGroupRequest() *CreateGroupRequest

NewCreateGroupRequest todo

func (*CreateGroupRequest) Descriptor deprecated

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

Deprecated: Use CreateGroupRequest.ProtoReflect.Descriptor instead.

func (*CreateGroupRequest) GetDescription

func (x *CreateGroupRequest) GetDescription() string

func (*CreateGroupRequest) GetName

func (x *CreateGroupRequest) GetName() string

func (*CreateGroupRequest) GetType

func (x *CreateGroupRequest) GetType() Type

func (*CreateGroupRequest) ProtoMessage

func (*CreateGroupRequest) ProtoMessage()

func (*CreateGroupRequest) ProtoReflect

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

func (*CreateGroupRequest) Reset

func (x *CreateGroupRequest) Reset()

func (*CreateGroupRequest) String

func (x *CreateGroupRequest) String() string

func (*CreateGroupRequest) Validate

func (req *CreateGroupRequest) Validate() error

type DeleteGroupRequest

type DeleteGroupRequest struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name"`
	// contains filtered or unexported fields
}

DeleteGroupRequest todo

func NewDeleteGroupRequestWithName

func NewDeleteGroupRequestWithName(name string) *DeleteGroupRequest

func (*DeleteGroupRequest) Descriptor deprecated

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

Deprecated: Use DeleteGroupRequest.ProtoReflect.Descriptor instead.

func (*DeleteGroupRequest) GetName

func (x *DeleteGroupRequest) GetName() string

func (*DeleteGroupRequest) ProtoMessage

func (*DeleteGroupRequest) ProtoMessage()

func (*DeleteGroupRequest) ProtoReflect

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

func (*DeleteGroupRequest) Reset

func (x *DeleteGroupRequest) Reset()

func (*DeleteGroupRequest) String

func (x *DeleteGroupRequest) String() string

func (*DeleteGroupRequest) Validate

func (req *DeleteGroupRequest) Validate() error

type DescribeGroupRequest

type DescribeGroupRequest struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name"`
	// contains filtered or unexported fields
}

DescribeGroupRequest todo

func NewDescribeGroupRequestWithName

func NewDescribeGroupRequestWithName(name string) *DescribeGroupRequest

func (*DescribeGroupRequest) Descriptor deprecated

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

Deprecated: Use DescribeGroupRequest.ProtoReflect.Descriptor instead.

func (*DescribeGroupRequest) GetName

func (x *DescribeGroupRequest) GetName() string

func (*DescribeGroupRequest) ProtoMessage

func (*DescribeGroupRequest) ProtoMessage()

func (*DescribeGroupRequest) ProtoReflect

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

func (*DescribeGroupRequest) Reset

func (x *DescribeGroupRequest) Reset()

func (*DescribeGroupRequest) String

func (x *DescribeGroupRequest) String() string

func (*DescribeGroupRequest) Validate

func (req *DescribeGroupRequest) Validate() error

type Group

type Group struct {

	// 组名称
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name" bson:"_id"`
	// 组类型
	Type Type `protobuf:"varint,2,opt,name=type,proto3,enum=keyauth.mconf.Type" json:"type" bson:"type"`
	// 创建人
	Creater string `protobuf:"bytes,3,opt,name=creater,proto3" json:"creater" bson:"creater"`
	// 创建的时间
	CreateAt int64 `protobuf:"varint,4,opt,name=create_at,json=createAt,proto3" json:"create_at" bson:"create_at"`
	// 描述信息
	Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description" bson:"description"`
	// contains filtered or unexported fields
}

Micro is service provider

func NewGroup

func NewGroup(req *CreateGroupRequest) (*Group, error)

New 创建服务

func (*Group) Descriptor deprecated

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

Deprecated: Use Group.ProtoReflect.Descriptor instead.

func (*Group) GetCreateAt

func (x *Group) GetCreateAt() int64

func (*Group) GetCreater

func (x *Group) GetCreater() string

func (*Group) GetDescription

func (x *Group) GetDescription() string

func (*Group) GetName

func (x *Group) GetName() string

func (*Group) GetType

func (x *Group) GetType() Type

func (*Group) ProtoMessage

func (*Group) ProtoMessage()

func (*Group) ProtoReflect

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

func (*Group) Reset

func (x *Group) Reset()

func (*Group) String

func (x *Group) String() string

type GroupSet

type GroupSet struct {
	Total int64    `protobuf:"varint,1,opt,name=total,proto3" json:"total" bson:"total"`
	Items []*Group `protobuf:"bytes,2,rep,name=items,proto3" json:"items" bson:"items"`
	// contains filtered or unexported fields
}

func NewGroupSet

func NewGroupSet() *GroupSet

NewMicroSet 实例化

func (*GroupSet) Add

func (s *GroupSet) Add(e *Group)

Add 添加

func (*GroupSet) Descriptor deprecated

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

Deprecated: Use GroupSet.ProtoReflect.Descriptor instead.

func (*GroupSet) GetItems

func (x *GroupSet) GetItems() []*Group

func (*GroupSet) GetTotal

func (x *GroupSet) GetTotal() int64

func (*GroupSet) ProtoMessage

func (*GroupSet) ProtoMessage()

func (*GroupSet) ProtoReflect

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

func (*GroupSet) Reset

func (x *GroupSet) Reset()

func (*GroupSet) String

func (x *GroupSet) String() string

type Item

type Item struct {

	// 项ID
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"`
	// 建的名称
	Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key" bson:"key"`
	// 关联的组
	Group string `protobuf:"bytes,3,opt,name=group,proto3" json:"group" bson:"group"`
	// 创建人
	Creater string `protobuf:"bytes,4,opt,name=creater,proto3" json:"creater" bson:"creater"`
	// 创建的时间
	CreateAt int64 `protobuf:"varint,5,opt,name=create_at,json=createAt,proto3" json:"create_at" bson:"create_at"`
	// 创建的时间
	Updater int64 `protobuf:"varint,6,opt,name=updater,proto3" json:"updater,omitempty" bson:"updater"`
	// 更新时间
	UpdateAt int64 `protobuf:"varint,7,opt,name=update_at,json=updateAt,proto3" json:"update_at,omitempty" bson:"update_at"`
	// 值对应的值
	Value string `protobuf:"bytes,8,opt,name=value,proto3" json:"value" bson:"value"`
	// 描述信息
	Description string `protobuf:"bytes,9,opt,name=description,proto3" json:"description,omitempty" bson:"description"`
	// contains filtered or unexported fields
}

Item 健值项

func NewItem

func NewItem(creater string, req *ItemRequest) *Item

func (*Item) Descriptor deprecated

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

Deprecated: Use Item.ProtoReflect.Descriptor instead.

func (*Item) GetCreateAt

func (x *Item) GetCreateAt() int64

func (*Item) GetCreater

func (x *Item) GetCreater() string

func (*Item) GetDescription

func (x *Item) GetDescription() string

func (*Item) GetGroup

func (x *Item) GetGroup() string

func (*Item) GetId

func (x *Item) GetId() string

func (*Item) GetKey

func (x *Item) GetKey() string

func (*Item) GetUpdateAt

func (x *Item) GetUpdateAt() int64

func (*Item) GetUpdater

func (x *Item) GetUpdater() int64

func (*Item) GetValue

func (x *Item) GetValue() string

func (*Item) ProtoMessage

func (*Item) ProtoMessage()

func (*Item) ProtoReflect

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

func (*Item) Reset

func (x *Item) Reset()

func (*Item) String

func (x *Item) String() string

type ItemRequest

type ItemRequest struct {

	// 建的名称
	Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key" bson:"_id"`
	// 关联的组
	Group string `protobuf:"bytes,2,opt,name=group,proto3" json:"group" bson:"group"`
	// 值对应的值
	Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value" bson:"value"`
	// 描述信息
	Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty" bson:"description"`
	// contains filtered or unexported fields
}

ItemRequest 健值项

func (*ItemRequest) Descriptor deprecated

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

Deprecated: Use ItemRequest.ProtoReflect.Descriptor instead.

func (*ItemRequest) GetDescription

func (x *ItemRequest) GetDescription() string

func (*ItemRequest) GetGroup

func (x *ItemRequest) GetGroup() string

func (*ItemRequest) GetKey

func (x *ItemRequest) GetKey() string

func (*ItemRequest) GetValue

func (x *ItemRequest) GetValue() string

func (*ItemRequest) ProtoMessage

func (*ItemRequest) ProtoMessage()

func (*ItemRequest) ProtoReflect

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

func (*ItemRequest) Reset

func (x *ItemRequest) Reset()

func (*ItemRequest) String

func (x *ItemRequest) String() string

type ItemSet

type ItemSet struct {
	Total int64   `protobuf:"varint,1,opt,name=total,proto3" json:"total" bson:"total"`
	Items []*Item `protobuf:"bytes,2,rep,name=items,proto3" json:"items" bson:"items"`
	// contains filtered or unexported fields
}

func NewGroupItemSet

func NewGroupItemSet(creater string, req *AddItemToGroupRequest) *ItemSet

func NewItemSet

func NewItemSet() *ItemSet

NewMicroSet 实例化

func (*ItemSet) Add

func (s *ItemSet) Add(e *Item)

Add 添加

func (*ItemSet) Descriptor deprecated

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

Deprecated: Use ItemSet.ProtoReflect.Descriptor instead.

func (*ItemSet) Docs

func (s *ItemSet) Docs() []interface{}

func (*ItemSet) GetItems

func (x *ItemSet) GetItems() []*Item

func (*ItemSet) GetTotal

func (x *ItemSet) GetTotal() int64

func (*ItemSet) ProtoMessage

func (*ItemSet) ProtoMessage()

func (*ItemSet) ProtoReflect

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

func (*ItemSet) Reset

func (x *ItemSet) Reset()

func (*ItemSet) String

func (x *ItemSet) String() string

type MicroConfigServiceClient

type MicroConfigServiceClient interface {
	CreateGroup(ctx context.Context, in *CreateGroupRequest, opts ...grpc.CallOption) (*Group, error)
	QueryGroup(ctx context.Context, in *QueryGroupRequest, opts ...grpc.CallOption) (*GroupSet, error)
	DeleteGroup(ctx context.Context, in *DeleteGroupRequest, opts ...grpc.CallOption) (*Group, error)
	QueryItem(ctx context.Context, in *QueryItemRequest, opts ...grpc.CallOption) (*ItemSet, error)
	AddItemToGroup(ctx context.Context, in *AddItemToGroupRequest, opts ...grpc.CallOption) (*ItemSet, error)
	RemoveItemFromGroup(ctx context.Context, in *RemoveItemFromGroupRequest, opts ...grpc.CallOption) (*ItemSet, error)
}

MicroConfigServiceClient is the client API for MicroConfigService 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 MicroConfigServiceServer

type MicroConfigServiceServer interface {
	CreateGroup(context.Context, *CreateGroupRequest) (*Group, error)
	QueryGroup(context.Context, *QueryGroupRequest) (*GroupSet, error)
	DeleteGroup(context.Context, *DeleteGroupRequest) (*Group, error)
	QueryItem(context.Context, *QueryItemRequest) (*ItemSet, error)
	AddItemToGroup(context.Context, *AddItemToGroupRequest) (*ItemSet, error)
	RemoveItemFromGroup(context.Context, *RemoveItemFromGroupRequest) (*ItemSet, error)
	// contains filtered or unexported methods
}

MicroConfigServiceServer is the server API for MicroConfigService service. All implementations must embed UnimplementedMicroConfigServiceServer for forward compatibility

type QueryGroupRequest

type QueryGroupRequest struct {
	Page *page.PageRequest `protobuf:"bytes,1,opt,name=page,proto3" json:"page"`
	// 组类型
	Type Type `protobuf:"varint,2,opt,name=type,proto3,enum=keyauth.mconf.Type" json:"type"`
	// contains filtered or unexported fields
}

QueryGroupRequest 查询组列表

func NewQueryGroupRequest

func NewQueryGroupRequest(pageReq *request.PageRequest) *QueryGroupRequest

NewQueryGroupRequest 列表查询请求

func (*QueryGroupRequest) Descriptor deprecated

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

Deprecated: Use QueryGroupRequest.ProtoReflect.Descriptor instead.

func (*QueryGroupRequest) GetPage

func (x *QueryGroupRequest) GetPage() *page.PageRequest

func (*QueryGroupRequest) GetType

func (x *QueryGroupRequest) GetType() Type

func (*QueryGroupRequest) ProtoMessage

func (*QueryGroupRequest) ProtoMessage()

func (*QueryGroupRequest) ProtoReflect

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

func (*QueryGroupRequest) Reset

func (x *QueryGroupRequest) Reset()

func (*QueryGroupRequest) String

func (x *QueryGroupRequest) String() string

type QueryItemRequest

type QueryItemRequest struct {
	Page *page.PageRequest `protobuf:"bytes,1,opt,name=page,proto3" json:"page"`
	// 组名称
	GroupName string `protobuf:"bytes,2,opt,name=group_name,json=groupName,proto3" json:"group_name" validate:"required,lte=200"`
	// contains filtered or unexported fields
}

QueryItemRequest 查询值列表

func NewQueryItemRequest

func NewQueryItemRequest(pageReq *request.PageRequest) *QueryItemRequest

NewQueryItemRequest 列表查询请求

func (*QueryItemRequest) Descriptor deprecated

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

Deprecated: Use QueryItemRequest.ProtoReflect.Descriptor instead.

func (*QueryItemRequest) GetGroupName

func (x *QueryItemRequest) GetGroupName() string

func (*QueryItemRequest) GetPage

func (x *QueryItemRequest) GetPage() *page.PageRequest

func (*QueryItemRequest) ProtoMessage

func (*QueryItemRequest) ProtoMessage()

func (*QueryItemRequest) ProtoReflect

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

func (*QueryItemRequest) Reset

func (x *QueryItemRequest) Reset()

func (*QueryItemRequest) String

func (x *QueryItemRequest) String() string

type RemoveItemFromGroupRequest

type RemoveItemFromGroupRequest struct {
	GroupName string   `protobuf:"bytes,1,opt,name=group_name,json=groupName,proto3" json:"group_name"`
	RemoveAll bool     `protobuf:"varint,2,opt,name=remove_all,json=removeAll,proto3" json:"remove_all"`
	Items     []string `protobuf:"bytes,3,rep,name=items,proto3" json:"items" bson:"items"`
	// contains filtered or unexported fields
}

RemoveItemFromGroupRequest todo

func (*RemoveItemFromGroupRequest) Descriptor deprecated

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

Deprecated: Use RemoveItemFromGroupRequest.ProtoReflect.Descriptor instead.

func (*RemoveItemFromGroupRequest) GetGroupName

func (x *RemoveItemFromGroupRequest) GetGroupName() string

func (*RemoveItemFromGroupRequest) GetItems

func (x *RemoveItemFromGroupRequest) GetItems() []string

func (*RemoveItemFromGroupRequest) GetRemoveAll

func (x *RemoveItemFromGroupRequest) GetRemoveAll() bool

func (*RemoveItemFromGroupRequest) ProtoMessage

func (*RemoveItemFromGroupRequest) ProtoMessage()

func (*RemoveItemFromGroupRequest) ProtoReflect

func (*RemoveItemFromGroupRequest) Reset

func (x *RemoveItemFromGroupRequest) Reset()

func (*RemoveItemFromGroupRequest) String

func (x *RemoveItemFromGroupRequest) String() string

type Type

type Type int32
const (
	// 全局配置, 所有服务可以读取
	Type_GLOBAL Type = 0
	// 组内配置, 组里面的服务可以读取
	Type_PRIVATE Type = 1
)

func ParseTypeFromString

func ParseTypeFromString(str string) (Type, error)

ParseTypeFromString Parse Type from string

func (Type) Descriptor

func (Type) Descriptor() protoreflect.EnumDescriptor

func (Type) Enum

func (x Type) Enum() *Type

func (Type) EnumDescriptor deprecated

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

Deprecated: Use Type.Descriptor instead.

func (Type) Equal

func (t Type) Equal(target Type) bool

Equal type compare

func (Type) IsIn

func (t Type) IsIn(targets ...Type) bool

IsIn todo

func (Type) MarshalJSON

func (t Type) MarshalJSON() ([]byte, error)

MarshalJSON todo

func (Type) Number

func (x Type) Number() protoreflect.EnumNumber

func (Type) String

func (x Type) String() string

func (Type) Type

func (Type) Type() protoreflect.EnumType

func (*Type) UnmarshalJSON

func (t *Type) UnmarshalJSON(b []byte) error

UnmarshalJSON todo

type UnimplementedMicroConfigServiceServer

type UnimplementedMicroConfigServiceServer struct {
}

UnimplementedMicroConfigServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedMicroConfigServiceServer) AddItemToGroup

func (UnimplementedMicroConfigServiceServer) CreateGroup

func (UnimplementedMicroConfigServiceServer) DeleteGroup

func (UnimplementedMicroConfigServiceServer) QueryGroup

func (UnimplementedMicroConfigServiceServer) QueryItem

func (UnimplementedMicroConfigServiceServer) RemoveItemFromGroup

type UnsafeMicroConfigServiceServer

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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