namespace

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppName = "namespace"
)
View Source
const (
	DefaultNamesapceName = "defalut"
)

Variables

View Source
var (
	Visible_name = map[int32]string{
		0: "PRIVATE",
		1: "PUBLIC",
	}
	Visible_value = map[string]int32{
		"PRIVATE": 0,
		"PUBLIC":  1,
	}
)

Enum value maps for Visible.

View Source
var File_apps_namespace_pb_namespace_proto protoreflect.FileDescriptor
View Source
var File_apps_namespace_pb_request_proto protoreflect.FileDescriptor
View Source
var File_apps_namespace_pb_service_proto protoreflect.FileDescriptor
View Source
var Service_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "infraboard.keyauth.namespace.Service",
	HandlerType: (*ServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateNamespace",
			Handler:    _Service_CreateNamespace_Handler,
		},
		{
			MethodName: "QueryNamespace",
			Handler:    _Service_QueryNamespace_Handler,
		},
		{
			MethodName: "DescribeNamespace",
			Handler:    _Service_DescribeNamespace_Handler,
		},
		{
			MethodName: "DeleteNamespace",
			Handler:    _Service_DeleteNamespace_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "apps/namespace/pb/service.proto",
}

Service_ServiceDesc is the grpc.ServiceDesc for Service 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 RegisterServiceServer

func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)

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 NewDefaultNamespace

func NewDefaultNamespace() *Namespace

NewDefaultNamespace todo

func (*Namespace) Descriptor deprecated

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

Deprecated: Use Namespace.ProtoReflect.Descriptor instead.

func (*Namespace) GetCreateAt

func (x *Namespace) GetCreateAt() int64

func (*Namespace) GetCreateBy

func (x *Namespace) GetCreateBy() string

func (*Namespace) GetDepartment

func (x *Namespace) GetDepartment() *department.Department

func (*Namespace) GetDepartmentId

func (x *Namespace) GetDepartmentId() string

func (*Namespace) GetDescription

func (x *Namespace) GetDescription() string

func (*Namespace) GetDomain

func (x *Namespace) GetDomain() string

func (*Namespace) GetEnabled

func (x *Namespace) GetEnabled() bool

func (*Namespace) GetId

func (x *Namespace) GetId() string

func (*Namespace) GetName

func (x *Namespace) GetName() string

func (*Namespace) GetOwner

func (x *Namespace) GetOwner() string

func (*Namespace) GetPicture

func (x *Namespace) GetPicture() string

func (*Namespace) GetUpdateAt

func (x *Namespace) GetUpdateAt() int64

func (*Namespace) GetVisible

func (x *Namespace) GetVisible() Visible

func (*Namespace) ProtoMessage

func (*Namespace) ProtoMessage()

func (*Namespace) ProtoReflect

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

func (*Namespace) Reset

func (x *Namespace) Reset()

func (*Namespace) String

func (x *Namespace) String() string

type QueryNamespaceRequest

type QueryNamespaceRequest struct {

	// 分页请求
	// @gotags: json:"page"
	Page *request.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 (*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 ServiceClient

type ServiceClient 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)
}

ServiceClient is the client API for Service 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 NewServiceClient

func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient

type ServiceServer

type ServiceServer 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
}

ServiceServer is the server API for Service service. All implementations must embed UnimplementedServiceServer for forward compatibility

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 NewNamespaceSet

func NewNamespaceSet() *Set

NewNamespaceSet 实例化

func (*Set) Add

func (s *Set) Add(item *Namespace)

Add 添加应用

func (*Set) Descriptor deprecated

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

Deprecated: Use Set.ProtoReflect.Descriptor instead.

func (*Set) GetItems

func (x *Set) GetItems() []*Namespace

func (*Set) GetTotal

func (x *Set) GetTotal() int64

func (*Set) ProtoMessage

func (*Set) ProtoMessage()

func (*Set) ProtoReflect

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

func (*Set) Reset

func (x *Set) Reset()

func (*Set) String

func (x *Set) String() string

type UnimplementedServiceServer

type UnimplementedServiceServer struct {
}

UnimplementedServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedServiceServer) CreateNamespace

func (UnimplementedServiceServer) DeleteNamespace

func (UnimplementedServiceServer) DescribeNamespace

func (UnimplementedServiceServer) QueryNamespace

type UnsafeServiceServer

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

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

type Visible

type Visible int32
const (
	// 默认空间是私有的
	Visible_PRIVATE Visible = 0
	// PUBLIC  公开的空间
	Visible_PUBLIC Visible = 1
)

func ParseVisibleFromString

func ParseVisibleFromString(str string) (Visible, error)

ParseVisibleFromString Parse Visible from string

func (Visible) Descriptor

func (Visible) Descriptor() protoreflect.EnumDescriptor

func (Visible) Enum

func (x Visible) Enum() *Visible

func (Visible) EnumDescriptor deprecated

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

Deprecated: Use Visible.Descriptor instead.

func (Visible) Equal

func (t Visible) Equal(target Visible) bool

Equal type compare

func (Visible) IsIn

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

IsIn todo

func (Visible) MarshalJSON

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

MarshalJSON todo

func (Visible) Number

func (x Visible) Number() protoreflect.EnumNumber

func (Visible) String

func (x Visible) String() string

func (Visible) Type

func (Visible) Type() protoreflect.EnumType

func (*Visible) UnmarshalJSON

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

UnmarshalJSON todo

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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