Documentation
¶
Index ¶
- Constants
- Variables
- func HttpEntry() *http.EntrySet
- func RegisterNamespaceServiceServer(s grpc.ServiceRegistrar, srv NamespaceServiceServer)
- type CreateNamespaceRequest
- func (*CreateNamespaceRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateNamespaceRequest) GetCreateBy() string
- func (x *CreateNamespaceRequest) GetDepartmentId() string
- func (x *CreateNamespaceRequest) GetDescription() string
- func (x *CreateNamespaceRequest) GetDomain() string
- func (x *CreateNamespaceRequest) GetName() string
- func (x *CreateNamespaceRequest) GetOwner() string
- func (x *CreateNamespaceRequest) GetPicture() string
- func (*CreateNamespaceRequest) ProtoMessage()
- func (x *CreateNamespaceRequest) ProtoReflect() protoreflect.Message
- func (x *CreateNamespaceRequest) Reset()
- func (x *CreateNamespaceRequest) String() string
- func (req *CreateNamespaceRequest) UpdateOwner(tk *token.Token)
- func (req *CreateNamespaceRequest) Validate() error
- type DeleteNamespaceRequest
- func (*DeleteNamespaceRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteNamespaceRequest) GetDomain() string
- func (x *DeleteNamespaceRequest) GetId() string
- func (*DeleteNamespaceRequest) ProtoMessage()
- func (x *DeleteNamespaceRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteNamespaceRequest) Reset()
- func (x *DeleteNamespaceRequest) String() string
- func (req *DeleteNamespaceRequest) Validate() error
- type DescriptNamespaceRequest
- func (*DescriptNamespaceRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DescriptNamespaceRequest) GetId() string
- func (x *DescriptNamespaceRequest) GetWithDepartment() bool
- func (*DescriptNamespaceRequest) ProtoMessage()
- func (x *DescriptNamespaceRequest) ProtoReflect() protoreflect.Message
- func (x *DescriptNamespaceRequest) Reset()
- func (x *DescriptNamespaceRequest) String() string
- func (req *DescriptNamespaceRequest) Validate() error
- type Namespace
- func (*Namespace) Descriptor() ([]byte, []int)deprecated
- func (x *Namespace) GetCreateAt() int64
- func (x *Namespace) GetCreateBy() string
- func (x *Namespace) GetDepartment() *department.Department
- func (x *Namespace) GetDepartmentId() string
- func (x *Namespace) GetDescription() string
- func (x *Namespace) GetDomain() string
- func (x *Namespace) GetEnabled() bool
- func (x *Namespace) GetId() string
- func (x *Namespace) GetName() string
- func (x *Namespace) GetOwner() string
- func (x *Namespace) GetPicture() string
- func (x *Namespace) GetUpdateAt() int64
- func (x *Namespace) GetVisible() Visible
- func (*Namespace) ProtoMessage()
- func (x *Namespace) ProtoReflect() protoreflect.Message
- func (x *Namespace) Reset()
- func (x *Namespace) String() string
- type NamespaceServiceClient
- type NamespaceServiceServer
- type QueryNamespaceRequest
- func (*QueryNamespaceRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QueryNamespaceRequest) GetAccount() string
- func (x *QueryNamespaceRequest) GetDepartmentId() string
- func (x *QueryNamespaceRequest) GetDomain() string
- func (x *QueryNamespaceRequest) GetName() string
- func (x *QueryNamespaceRequest) GetPage() *page.PageRequest
- func (x *QueryNamespaceRequest) GetWithDepartment() bool
- func (x *QueryNamespaceRequest) GetWithSubDepartment() bool
- func (*QueryNamespaceRequest) ProtoMessage()
- func (x *QueryNamespaceRequest) ProtoReflect() protoreflect.Message
- func (x *QueryNamespaceRequest) Reset()
- func (x *QueryNamespaceRequest) String() string
- func (req *QueryNamespaceRequest) UpdateOwner(tk *token.Token)
- type Set
- type UnimplementedNamespaceServiceServer
- func (UnimplementedNamespaceServiceServer) CreateNamespace(context.Context, *CreateNamespaceRequest) (*Namespace, error)
- func (UnimplementedNamespaceServiceServer) DeleteNamespace(context.Context, *DeleteNamespaceRequest) (*Namespace, error)
- func (UnimplementedNamespaceServiceServer) DescribeNamespace(context.Context, *DescriptNamespaceRequest) (*Namespace, error)
- func (UnimplementedNamespaceServiceServer) QueryNamespace(context.Context, *QueryNamespaceRequest) (*Set, error)
- type UnsafeNamespaceServiceServer
- type Visible
- func (Visible) Descriptor() protoreflect.EnumDescriptor
- func (x Visible) Enum() *Visible
- func (Visible) EnumDescriptor() ([]byte, []int)deprecated
- func (t Visible) Equal(target Visible) bool
- func (t Visible) IsIn(targets ...Visible) bool
- func (t Visible) MarshalJSON() ([]byte, error)
- func (x Visible) Number() protoreflect.EnumNumber
- func (x Visible) String() string
- func (Visible) Type() protoreflect.EnumType
- func (t *Visible) UnmarshalJSON(b []byte) error
Constants ¶
const (
AppName = "namespace"
)
Variables ¶
var ( Visible_name = map[int32]string{ 0: "PRIVATE", 1: "PUBLIC", } Visible_value = map[string]int32{ "PRIVATE": 0, "PUBLIC": 1, } )
Enum value maps for Visible.
var File_app_namespace_pb_namespace_proto protoreflect.FileDescriptor
var File_app_namespace_pb_request_proto protoreflect.FileDescriptor
var File_app_namespace_pb_service_proto protoreflect.FileDescriptor
var NamespaceService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "infraboard.keyauth.namespace.NamespaceService", HandlerType: (*NamespaceServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateNamespace", Handler: _NamespaceService_CreateNamespace_Handler, }, { MethodName: "QueryNamespace", Handler: _NamespaceService_QueryNamespace_Handler, }, { MethodName: "DescribeNamespace", Handler: _NamespaceService_DescribeNamespace_Handler, }, { MethodName: "DeleteNamespace", Handler: _NamespaceService_DeleteNamespace_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "app/namespace/pb/service.proto", }
NamespaceService_ServiceDesc is the grpc.ServiceDesc for NamespaceService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterNamespaceServiceServer ¶
func RegisterNamespaceServiceServer(s grpc.ServiceRegistrar, srv NamespaceServiceServer)
Types ¶
type CreateNamespaceRequest ¶
type CreateNamespaceRequest struct {
// 所属部门
// @gotags: json:"department_id" validate:"required,lte=80"
DepartmentId string `protobuf:"bytes,1,opt,name=department_id,json=departmentId,proto3" json:"department_id" validate:"required,lte=80"`
// 项目名称
// @gotags: json:"name" validate:"required,lte=80"
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name" validate:"required,lte=80"`
// 项目描述图片
// @gotags: json:"picture,omitempty"
Picture string `protobuf:"bytes,3,opt,name=picture,proto3" json:"picture,omitempty"`
// 项目所有者, PMO
// @gotags: json:"owner,omitempty"
Owner string `protobuf:"bytes,5,opt,name=owner,proto3" json:"owner,omitempty"`
// 项目描述
// @gotags: json:"description,omitempty"
Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"`
// @gotags: json:"domain"
Domain string `protobuf:"bytes,7,opt,name=domain,proto3" json:"domain"`
// 创建者
// @gotags: json:"create_by"
CreateBy string `protobuf:"bytes,8,opt,name=create_by,json=createBy,proto3" json:"create_by"`
// contains filtered or unexported fields
}
CreateNamespaceRequest 创建项目请求
func NewCreateNamespaceRequest ¶
func NewCreateNamespaceRequest() *CreateNamespaceRequest
NewCreateNamespaceRequest todo
func (*CreateNamespaceRequest) Descriptor
deprecated
func (*CreateNamespaceRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateNamespaceRequest.ProtoReflect.Descriptor instead.
func (*CreateNamespaceRequest) GetCreateBy ¶
func (x *CreateNamespaceRequest) GetCreateBy() string
func (*CreateNamespaceRequest) GetDepartmentId ¶
func (x *CreateNamespaceRequest) GetDepartmentId() string
func (*CreateNamespaceRequest) GetDescription ¶
func (x *CreateNamespaceRequest) GetDescription() string
func (*CreateNamespaceRequest) GetDomain ¶
func (x *CreateNamespaceRequest) GetDomain() string
func (*CreateNamespaceRequest) GetName ¶
func (x *CreateNamespaceRequest) GetName() string
func (*CreateNamespaceRequest) GetOwner ¶
func (x *CreateNamespaceRequest) GetOwner() string
func (*CreateNamespaceRequest) GetPicture ¶
func (x *CreateNamespaceRequest) GetPicture() string
func (*CreateNamespaceRequest) ProtoMessage ¶
func (*CreateNamespaceRequest) ProtoMessage()
func (*CreateNamespaceRequest) ProtoReflect ¶
func (x *CreateNamespaceRequest) ProtoReflect() protoreflect.Message
func (*CreateNamespaceRequest) Reset ¶
func (x *CreateNamespaceRequest) Reset()
func (*CreateNamespaceRequest) String ¶
func (x *CreateNamespaceRequest) String() string
func (*CreateNamespaceRequest) UpdateOwner ¶
func (req *CreateNamespaceRequest) UpdateOwner(tk *token.Token)
func (*CreateNamespaceRequest) Validate ¶
func (req *CreateNamespaceRequest) Validate() error
Validate todo
type DeleteNamespaceRequest ¶
type DeleteNamespaceRequest struct {
// @gotags: json:"id"
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id"`
// @gotags: json:"domain"
Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain"`
// contains filtered or unexported fields
}
DeleteNamespaceRequest todo
func NewDeleteNamespaceRequestWithID ¶
func NewDeleteNamespaceRequestWithID(id string) *DeleteNamespaceRequest
NewDeleteNamespaceRequestWithID todo
func (*DeleteNamespaceRequest) Descriptor
deprecated
func (*DeleteNamespaceRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteNamespaceRequest.ProtoReflect.Descriptor instead.
func (*DeleteNamespaceRequest) GetDomain ¶
func (x *DeleteNamespaceRequest) GetDomain() string
func (*DeleteNamespaceRequest) GetId ¶
func (x *DeleteNamespaceRequest) GetId() string
func (*DeleteNamespaceRequest) ProtoMessage ¶
func (*DeleteNamespaceRequest) ProtoMessage()
func (*DeleteNamespaceRequest) ProtoReflect ¶
func (x *DeleteNamespaceRequest) ProtoReflect() protoreflect.Message
func (*DeleteNamespaceRequest) Reset ¶
func (x *DeleteNamespaceRequest) Reset()
func (*DeleteNamespaceRequest) String ¶
func (x *DeleteNamespaceRequest) String() string
func (*DeleteNamespaceRequest) Validate ¶
func (req *DeleteNamespaceRequest) Validate() error
Validate todo
type DescriptNamespaceRequest ¶
type DescriptNamespaceRequest struct {
// @gotags: json:"id"
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id"`
// @gotags: json:"with_department"
WithDepartment bool `protobuf:"varint,2,opt,name=with_department,json=withDepartment,proto3" json:"with_department"`
// contains filtered or unexported fields
}
DescriptNamespaceRequest 查询应用详情
func NewDescriptNamespaceRequest ¶
func NewDescriptNamespaceRequest() *DescriptNamespaceRequest
NewDescriptNamespaceRequest new实例
func NewNewDescriptNamespaceRequestWithID ¶
func NewNewDescriptNamespaceRequestWithID(id string) *DescriptNamespaceRequest
NewNewDescriptNamespaceRequestWithID todo
func (*DescriptNamespaceRequest) Descriptor
deprecated
func (*DescriptNamespaceRequest) Descriptor() ([]byte, []int)
Deprecated: Use DescriptNamespaceRequest.ProtoReflect.Descriptor instead.
func (*DescriptNamespaceRequest) GetId ¶
func (x *DescriptNamespaceRequest) GetId() string
func (*DescriptNamespaceRequest) GetWithDepartment ¶
func (x *DescriptNamespaceRequest) GetWithDepartment() bool
func (*DescriptNamespaceRequest) ProtoMessage ¶
func (*DescriptNamespaceRequest) ProtoMessage()
func (*DescriptNamespaceRequest) ProtoReflect ¶
func (x *DescriptNamespaceRequest) ProtoReflect() protoreflect.Message
func (*DescriptNamespaceRequest) Reset ¶
func (x *DescriptNamespaceRequest) Reset()
func (*DescriptNamespaceRequest) String ¶
func (x *DescriptNamespaceRequest) String() string
func (*DescriptNamespaceRequest) Validate ¶
func (req *DescriptNamespaceRequest) Validate() error
Validate 校验详情查询请求
type Namespace ¶
type Namespace struct {
// 项目唯一ID
// @gotags: bson:"_id" json:"id"
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"`
// 所属域ID
// @gotags: bson:"domain" json:"domain"
Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain" bson:"domain"`
// 创建人
// @gotags: bson:"create_by" json:"create_by"
CreateBy string `protobuf:"bytes,3,opt,name=create_by,json=createBy,proto3" json:"create_by" bson:"create_by"`
// 创建时间
// @gotags: bson:"create_at" json:"create_at"
CreateAt int64 `protobuf:"varint,4,opt,name=create_at,json=createAt,proto3" json:"create_at" bson:"create_at"`
// 项目修改时间
// @gotags: bson:"update_at" json:"update_at"
UpdateAt int64 `protobuf:"varint,5,opt,name=update_at,json=updateAt,proto3" json:"update_at" bson:"update_at"`
// 禁用项目, 该项目所有人暂时都无法访问
// @gotags: bson:"enabled" json:"enabled"
Enabled bool `protobuf:"varint,6,opt,name=enabled,proto3" json:"enabled" bson:"enabled"`
// 所属部门
// @gotags: bson:"department_id" json:"department_id"
DepartmentId string `protobuf:"bytes,7,opt,name=department_id,json=departmentId,proto3" json:"department_id" bson:"department_id"`
// 项目名称
// @gotags: bson:"name" json:"name"'
Name string `protobuf:"bytes,8,opt,name=name,proto3" json:"name" bson:"name"`
// 项目描述图片
// @gotags: bson:"picture" json:"picture"
Picture string `protobuf:"bytes,9,opt,name=picture,proto3" json:"picture" bson:"picture"`
// 项目所有者, PMO
// @gotags: bson:"owner" json:"owner"
Owner string `protobuf:"bytes,10,opt,name=owner,proto3" json:"owner" bson:"owner"`
// 项目描述
// @gotags: bson:"description" json:"description"
Description string `protobuf:"bytes,11,opt,name=description,proto3" json:"description" bson:"description"`
// 补充的部门
// @gotags: bson:"-" json:"department,omitempty"
Department *department.Department `protobuf:"bytes,12,opt,name=department,proto3" json:"department,omitempty" bson:"-"`
// 空间可见性, 默认是私有空间
// @gotags: bson:"-" bson:"visible" json:"visible"
Visible Visible `protobuf:"varint,13,opt,name=visible,proto3,enum=infraboard.keyauth.namespace.Visible" json:"visible" bson:"-" bson:"visible"`
// contains filtered or unexported fields
}
Namespace tenant resource container
func (*Namespace) Descriptor
deprecated
func (*Namespace) GetCreateAt ¶
func (*Namespace) GetCreateBy ¶
func (*Namespace) GetDepartment ¶
func (x *Namespace) GetDepartment() *department.Department
func (*Namespace) GetDepartmentId ¶
func (*Namespace) GetDescription ¶
func (*Namespace) GetEnabled ¶
func (*Namespace) GetPicture ¶
func (*Namespace) GetUpdateAt ¶
func (*Namespace) GetVisible ¶
func (*Namespace) ProtoMessage ¶
func (*Namespace) ProtoMessage()
func (*Namespace) ProtoReflect ¶
func (x *Namespace) ProtoReflect() protoreflect.Message
type NamespaceServiceClient ¶
type NamespaceServiceClient interface {
CreateNamespace(ctx context.Context, in *CreateNamespaceRequest, opts ...grpc.CallOption) (*Namespace, error)
QueryNamespace(ctx context.Context, in *QueryNamespaceRequest, opts ...grpc.CallOption) (*Set, error)
DescribeNamespace(ctx context.Context, in *DescriptNamespaceRequest, opts ...grpc.CallOption) (*Namespace, error)
DeleteNamespace(ctx context.Context, in *DeleteNamespaceRequest, opts ...grpc.CallOption) (*Namespace, error)
}
NamespaceServiceClient is the client API for NamespaceService 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.
func NewNamespaceServiceClient ¶
func NewNamespaceServiceClient(cc grpc.ClientConnInterface) NamespaceServiceClient
type NamespaceServiceServer ¶
type NamespaceServiceServer interface {
CreateNamespace(context.Context, *CreateNamespaceRequest) (*Namespace, error)
QueryNamespace(context.Context, *QueryNamespaceRequest) (*Set, error)
DescribeNamespace(context.Context, *DescriptNamespaceRequest) (*Namespace, error)
DeleteNamespace(context.Context, *DeleteNamespaceRequest) (*Namespace, error)
// contains filtered or unexported methods
}
NamespaceServiceServer is the server API for NamespaceService service. All implementations must embed UnimplementedNamespaceServiceServer for forward compatibility
type QueryNamespaceRequest ¶
type QueryNamespaceRequest struct {
// 分页请求
// @gotags: json:"page"
Page *page.PageRequest `protobuf:"bytes,1,opt,name=page,proto3" json:"page"`
// 空间的名称
// @gotags: json:"name"
Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name"`
// 该用户加入的空间
// @gotags: json:"account"
Account string `protobuf:"bytes,6,opt,name=account,proto3" json:"account"`
// 该部门下的空间
// @gotags: json:"department_id"
DepartmentId string `protobuf:"bytes,2,opt,name=department_id,json=departmentId,proto3" json:"department_id"`
// 是否返回子部门的信息
// @gotags: json:"with_sub_department"
WithSubDepartment bool `protobuf:"varint,3,opt,name=with_sub_department,json=withSubDepartment,proto3" json:"with_sub_department"`
// 是否返回部门的信息
// @gotags: json:"with_department"
WithDepartment bool `protobuf:"varint,4,opt,name=with_department,json=withDepartment,proto3" json:"with_department"`
// @gotags: json:"domain"
Domain string `protobuf:"bytes,7,opt,name=domain,proto3" json:"domain"`
// contains filtered or unexported fields
}
QueryNamespaceRequest 查询应用列表
func NewQueryNamespaceRequest ¶
func NewQueryNamespaceRequest(pageReq *request.PageRequest) *QueryNamespaceRequest
NewQueryNamespaceRequest 列表查询请求
func NewQueryNamespaceRequestFromHTTP ¶
func NewQueryNamespaceRequestFromHTTP(r *http.Request) *QueryNamespaceRequest
NewQueryNamespaceRequestFromHTTP 列表查询请求
func (*QueryNamespaceRequest) Descriptor
deprecated
func (*QueryNamespaceRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryNamespaceRequest.ProtoReflect.Descriptor instead.
func (*QueryNamespaceRequest) GetAccount ¶
func (x *QueryNamespaceRequest) GetAccount() string
func (*QueryNamespaceRequest) GetDepartmentId ¶
func (x *QueryNamespaceRequest) GetDepartmentId() string
func (*QueryNamespaceRequest) GetDomain ¶
func (x *QueryNamespaceRequest) GetDomain() string
func (*QueryNamespaceRequest) GetName ¶
func (x *QueryNamespaceRequest) GetName() string
func (*QueryNamespaceRequest) GetPage ¶
func (x *QueryNamespaceRequest) GetPage() *page.PageRequest
func (*QueryNamespaceRequest) GetWithDepartment ¶
func (x *QueryNamespaceRequest) GetWithDepartment() bool
func (*QueryNamespaceRequest) GetWithSubDepartment ¶
func (x *QueryNamespaceRequest) GetWithSubDepartment() bool
func (*QueryNamespaceRequest) ProtoMessage ¶
func (*QueryNamespaceRequest) ProtoMessage()
func (*QueryNamespaceRequest) ProtoReflect ¶
func (x *QueryNamespaceRequest) ProtoReflect() protoreflect.Message
func (*QueryNamespaceRequest) Reset ¶
func (x *QueryNamespaceRequest) Reset()
func (*QueryNamespaceRequest) String ¶
func (x *QueryNamespaceRequest) String() string
func (*QueryNamespaceRequest) UpdateOwner ¶
func (req *QueryNamespaceRequest) UpdateOwner(tk *token.Token)
type Set ¶
type Set struct {
// @gotags: bson:"total" json:"total"
Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total" bson:"total"`
// @gotags: bson:"items" json:"items"
Items []*Namespace `protobuf:"bytes,2,rep,name=items,proto3" json:"items" bson:"items"`
// contains filtered or unexported fields
}
func (*Set) Descriptor
deprecated
func (*Set) ProtoMessage ¶
func (*Set) ProtoMessage()
func (*Set) ProtoReflect ¶
func (x *Set) ProtoReflect() protoreflect.Message
type UnimplementedNamespaceServiceServer ¶
type UnimplementedNamespaceServiceServer struct {
}
UnimplementedNamespaceServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedNamespaceServiceServer) CreateNamespace ¶
func (UnimplementedNamespaceServiceServer) CreateNamespace(context.Context, *CreateNamespaceRequest) (*Namespace, error)
func (UnimplementedNamespaceServiceServer) DeleteNamespace ¶
func (UnimplementedNamespaceServiceServer) DeleteNamespace(context.Context, *DeleteNamespaceRequest) (*Namespace, error)
func (UnimplementedNamespaceServiceServer) DescribeNamespace ¶
func (UnimplementedNamespaceServiceServer) DescribeNamespace(context.Context, *DescriptNamespaceRequest) (*Namespace, error)
func (UnimplementedNamespaceServiceServer) QueryNamespace ¶
func (UnimplementedNamespaceServiceServer) QueryNamespace(context.Context, *QueryNamespaceRequest) (*Set, error)
type UnsafeNamespaceServiceServer ¶
type UnsafeNamespaceServiceServer interface {
// contains filtered or unexported methods
}
UnsafeNamespaceServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to NamespaceServiceServer will result in compilation errors.
type Visible ¶
type Visible int32
func ParseVisibleFromString ¶
ParseVisibleFromString Parse Visible from string
func (Visible) Descriptor ¶
func (Visible) Descriptor() protoreflect.EnumDescriptor
func (Visible) EnumDescriptor
deprecated
func (Visible) Number ¶
func (x Visible) Number() protoreflect.EnumNumber
func (Visible) Type ¶
func (Visible) Type() protoreflect.EnumType