Documentation ¶
Index ¶
- Constants
- Variables
- func HttpEntry() *http.EntrySet
- func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
- type CreatePolicyRequest
- func (*CreatePolicyRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreatePolicyRequest) GetAccount() string
- func (x *CreatePolicyRequest) GetCreater() string
- func (x *CreatePolicyRequest) GetDomain() string
- func (x *CreatePolicyRequest) GetExpiredTime() int64
- func (x *CreatePolicyRequest) GetNamespaceId() string
- func (x *CreatePolicyRequest) GetRoleId() string
- func (x *CreatePolicyRequest) GetScope() string
- func (x *CreatePolicyRequest) GetType() PolicyType
- func (*CreatePolicyRequest) ProtoMessage()
- func (x *CreatePolicyRequest) ProtoReflect() protoreflect.Message
- func (x *CreatePolicyRequest) Reset()
- func (x *CreatePolicyRequest) String() string
- func (req *CreatePolicyRequest) Validate() error
- type DeletePolicyRequest
- func NewDeletePolicyRequest() *DeletePolicyRequest
- func NewDeletePolicyRequestWithAccount(account string) *DeletePolicyRequest
- func NewDeletePolicyRequestWithID(id string) *DeletePolicyRequest
- func NewDeletePolicyRequestWithNamespaceID(namespaceID string) *DeletePolicyRequest
- func NewDeletePolicyRequestWithRoleID(roleID string) *DeletePolicyRequest
- func (*DeletePolicyRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeletePolicyRequest) GetAccount() string
- func (x *DeletePolicyRequest) GetDomain() string
- func (x *DeletePolicyRequest) GetId() string
- func (x *DeletePolicyRequest) GetNamespaceId() string
- func (x *DeletePolicyRequest) GetRoleId() string
- func (x *DeletePolicyRequest) GetType() PolicyType
- func (*DeletePolicyRequest) ProtoMessage()
- func (x *DeletePolicyRequest) ProtoReflect() protoreflect.Message
- func (x *DeletePolicyRequest) Reset()
- func (x *DeletePolicyRequest) String() string
- func (req *DeletePolicyRequest) Validate() error
- type DescribePolicyRequest
- func (*DescribePolicyRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DescribePolicyRequest) GetId() string
- func (*DescribePolicyRequest) ProtoMessage()
- func (x *DescribePolicyRequest) ProtoReflect() protoreflect.Message
- func (x *DescribePolicyRequest) Reset()
- func (x *DescribePolicyRequest) String() string
- func (req *DescribePolicyRequest) Validate() error
- type Policy
- func (p *Policy) CheckDependence(ctx context.Context, u user.ServiceServer, r role.ServiceServer, ...) (*user.User, error)
- func (*Policy) Descriptor() ([]byte, []int)deprecated
- func (x *Policy) GetAccount() string
- func (x *Policy) GetCreateAt() int64
- func (x *Policy) GetCreater() string
- func (x *Policy) GetDomain() string
- func (x *Policy) GetExpiredTime() int64
- func (x *Policy) GetId() string
- func (x *Policy) GetNamespace() *namespace.Namespace
- func (x *Policy) GetNamespaceId() string
- func (x *Policy) GetRole() *role.Role
- func (x *Policy) GetRoleId() string
- func (x *Policy) GetScope() string
- func (x *Policy) GetType() PolicyType
- func (x *Policy) GetUpdateAt() int64
- func (x *Policy) GetUserType() types.UserType
- func (p *Policy) IsAllNamespace() bool
- func (*Policy) ProtoMessage()
- func (x *Policy) ProtoReflect() protoreflect.Message
- func (x *Policy) Reset()
- func (x *Policy) String() string
- type PolicyType
- func (PolicyType) Descriptor() protoreflect.EnumDescriptor
- func (x PolicyType) Enum() *PolicyType
- func (PolicyType) EnumDescriptor() ([]byte, []int)deprecated
- func (t PolicyType) Equal(target PolicyType) bool
- func (t PolicyType) IsIn(targets ...PolicyType) bool
- func (t PolicyType) MarshalJSON() ([]byte, error)
- func (x PolicyType) Number() protoreflect.EnumNumber
- func (x PolicyType) String() string
- func (PolicyType) Type() protoreflect.EnumType
- func (t *PolicyType) UnmarshalJSON(b []byte) error
- type QueryPolicyRequest
- func (req *QueryPolicyRequest) CheckOwner(account string) bool
- func (*QueryPolicyRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QueryPolicyRequest) GetAccount() string
- func (x *QueryPolicyRequest) GetDomain() string
- func (x *QueryPolicyRequest) GetNamespaceId() string
- func (x *QueryPolicyRequest) GetPage() *page.PageRequest
- func (x *QueryPolicyRequest) GetRoleId() string
- func (x *QueryPolicyRequest) GetType() PolicyType
- func (x *QueryPolicyRequest) GetWithNamespace() bool
- func (x *QueryPolicyRequest) GetWithRole() bool
- func (*QueryPolicyRequest) ProtoMessage()
- func (x *QueryPolicyRequest) ProtoReflect() protoreflect.Message
- func (x *QueryPolicyRequest) Reset()
- func (x *QueryPolicyRequest) String() string
- func (req *QueryPolicyRequest) Validate() error
- type ServiceClient
- type ServiceServer
- type Set
- func (s *Set) Add(e *Policy)
- func (*Set) Descriptor() ([]byte, []int)deprecated
- func (x *Set) GetItems() []*Policy
- func (s *Set) GetNamespace() (nss []string)
- func (s *Set) GetNamespaceWithPage(page *page.PageRequest) (nss []string, total int64)
- func (s *Set) GetRoles(ctx context.Context, r role.ServiceServer, withPermission bool) (*role.Set, error)
- func (s *Set) GetScope(account string) string
- func (x *Set) GetTotal() int64
- func (s *Set) Length() int
- func (*Set) ProtoMessage()
- func (x *Set) ProtoReflect() protoreflect.Message
- func (x *Set) Reset()
- func (x *Set) String() string
- func (s *Set) UserRoles(account string) []string
- func (s *Set) Users() []string
- type UnimplementedServiceServer
- func (UnimplementedServiceServer) CreatePolicy(context.Context, *CreatePolicyRequest) (*Policy, error)
- func (UnimplementedServiceServer) DeletePolicy(context.Context, *DeletePolicyRequest) (*Policy, error)
- func (UnimplementedServiceServer) DescribePolicy(context.Context, *DescribePolicyRequest) (*Policy, error)
- func (UnimplementedServiceServer) QueryPolicy(context.Context, *QueryPolicyRequest) (*Set, error)
- type UnsafeServiceServer
Constants ¶
const (
AppName = "policy"
)
const (
MaxUserPolicy = 2048
)
Variables ¶
var ( PolicyType_name = map[int32]string{ 0: "NULL", 1: "CUSTOM", 2: "BUILD_IN", } PolicyType_value = map[string]int32{ "NULL": 0, "CUSTOM": 1, "BUILD_IN": 2, } )
Enum value maps for PolicyType.
var File_app_policy_pb_enum_proto protoreflect.FileDescriptor
var File_app_policy_pb_policy_proto protoreflect.FileDescriptor
var File_app_policy_pb_request_proto protoreflect.FileDescriptor
var File_app_policy_pb_service_proto protoreflect.FileDescriptor
var Service_ServiceDesc = grpc.ServiceDesc{ ServiceName: "infraboard.keyauth.policy.Service", HandlerType: (*ServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreatePolicy", Handler: _Service_CreatePolicy_Handler, }, { MethodName: "QueryPolicy", Handler: _Service_QueryPolicy_Handler, }, { MethodName: "DescribePolicy", Handler: _Service_DescribePolicy_Handler, }, { MethodName: "DeletePolicy", Handler: _Service_DeletePolicy_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "app/policy/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 RegisterServiceServer ¶ added in v0.6.4
func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
Types ¶
type CreatePolicyRequest ¶
type CreatePolicyRequest struct { // 范围 // @gotags: bson:"namespace_id" json:"namespace_id" validate:"lte=120" NamespaceId string `protobuf:"bytes,1,opt,name=namespace_id,json=namespaceId,proto3" json:"namespace_id" bson:"namespace_id" validate:"lte=120"` // 用户 // @gotags: bson:"account" json:"account" validate:"required,lte=120" Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account" bson:"account" validate:"required,lte=120"` // 角色名称 // @gotags: bson:"role_id" json:"role_id" validate:"required,lte=40" RoleId string `protobuf:"bytes,3,opt,name=role_id,json=roleId,proto3" json:"role_id" bson:"role_id" validate:"required,lte=40"` // 范围控制 // @gotags: bson:"scope" json:"scope" Scope string `protobuf:"bytes,4,opt,name=scope,proto3" json:"scope" bson:"scope"` // 策略过期时间 // @gotags: bson:"expired_time" json:"expired_time" ExpiredTime int64 `protobuf:"varint,5,opt,name=expired_time,json=expiredTime,proto3" json:"expired_time" bson:"expired_time"` // 策略的类型 // @gotags: bson:"type" json:"type" Type PolicyType `protobuf:"varint,6,opt,name=type,proto3,enum=infraboard.keyauth.policy.PolicyType" json:"type" bson:"type"` // 策略所属域 // @gotags: bson:"domain" json:"domain" Domain string `protobuf:"bytes,7,opt,name=domain,proto3" json:"domain" bson:"domain"` // 创建者ID // @gotags: bson:"creater" json:"creater" Creater string `protobuf:"bytes,8,opt,name=creater,proto3" json:"creater" bson:"creater"` // contains filtered or unexported fields }
CreatePolicyRequest 创建策略的请求
func NewCreatePolicyRequest ¶
func NewCreatePolicyRequest() *CreatePolicyRequest
NewCreatePolicyRequest 请求实例
func (*CreatePolicyRequest) Descriptor
deprecated
func (*CreatePolicyRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreatePolicyRequest.ProtoReflect.Descriptor instead.
func (*CreatePolicyRequest) GetAccount ¶
func (x *CreatePolicyRequest) GetAccount() string
func (*CreatePolicyRequest) GetCreater ¶
func (x *CreatePolicyRequest) GetCreater() string
func (*CreatePolicyRequest) GetDomain ¶
func (x *CreatePolicyRequest) GetDomain() string
func (*CreatePolicyRequest) GetExpiredTime ¶
func (x *CreatePolicyRequest) GetExpiredTime() int64
func (*CreatePolicyRequest) GetNamespaceId ¶
func (x *CreatePolicyRequest) GetNamespaceId() string
func (*CreatePolicyRequest) GetRoleId ¶
func (x *CreatePolicyRequest) GetRoleId() string
func (*CreatePolicyRequest) GetScope ¶
func (x *CreatePolicyRequest) GetScope() string
func (*CreatePolicyRequest) GetType ¶
func (x *CreatePolicyRequest) GetType() PolicyType
func (*CreatePolicyRequest) ProtoMessage ¶
func (*CreatePolicyRequest) ProtoMessage()
func (*CreatePolicyRequest) ProtoReflect ¶
func (x *CreatePolicyRequest) ProtoReflect() protoreflect.Message
func (*CreatePolicyRequest) Reset ¶
func (x *CreatePolicyRequest) Reset()
func (*CreatePolicyRequest) String ¶
func (x *CreatePolicyRequest) String() string
func (*CreatePolicyRequest) Validate ¶
func (req *CreatePolicyRequest) Validate() error
Validate 校验请求合法
type DeletePolicyRequest ¶
type DeletePolicyRequest struct { // @gotags: json:"id" Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id"` // @gotags: json:"account,omitempty" Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty"` // @gotags: json:"role_id,omitempty" RoleId string `protobuf:"bytes,3,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` // @gotags: json:"namespace_id,omitempty" NamespaceId string `protobuf:"bytes,4,opt,name=namespace_id,json=namespaceId,proto3" json:"namespace_id,omitempty"` // @gotags: json:"type,omitempty" Type PolicyType `protobuf:"varint,5,opt,name=type,proto3,enum=infraboard.keyauth.policy.PolicyType" json:"type,omitempty"` // @gotags: json:"domain" Domain string `protobuf:"bytes,6,opt,name=domain,proto3" json:"domain"` // contains filtered or unexported fields }
DeletePolicyRequest todo
func NewDeletePolicyRequest ¶
func NewDeletePolicyRequest() *DeletePolicyRequest
NewDeletePolicyRequest todo
func NewDeletePolicyRequestWithAccount ¶
func NewDeletePolicyRequestWithAccount(account string) *DeletePolicyRequest
NewDeletePolicyRequestWithAccount todo
func NewDeletePolicyRequestWithID ¶
func NewDeletePolicyRequestWithID(id string) *DeletePolicyRequest
NewDeletePolicyRequestWithID todo
func NewDeletePolicyRequestWithNamespaceID ¶
func NewDeletePolicyRequestWithNamespaceID(namespaceID string) *DeletePolicyRequest
NewDeletePolicyRequestWithNamespaceID todo
func NewDeletePolicyRequestWithRoleID ¶
func NewDeletePolicyRequestWithRoleID(roleID string) *DeletePolicyRequest
NewDeletePolicyRequestWithRoleID todo
func (*DeletePolicyRequest) Descriptor
deprecated
func (*DeletePolicyRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeletePolicyRequest.ProtoReflect.Descriptor instead.
func (*DeletePolicyRequest) GetAccount ¶
func (x *DeletePolicyRequest) GetAccount() string
func (*DeletePolicyRequest) GetDomain ¶
func (x *DeletePolicyRequest) GetDomain() string
func (*DeletePolicyRequest) GetId ¶
func (x *DeletePolicyRequest) GetId() string
func (*DeletePolicyRequest) GetNamespaceId ¶
func (x *DeletePolicyRequest) GetNamespaceId() string
func (*DeletePolicyRequest) GetRoleId ¶
func (x *DeletePolicyRequest) GetRoleId() string
func (*DeletePolicyRequest) GetType ¶
func (x *DeletePolicyRequest) GetType() PolicyType
func (*DeletePolicyRequest) ProtoMessage ¶
func (*DeletePolicyRequest) ProtoMessage()
func (*DeletePolicyRequest) ProtoReflect ¶
func (x *DeletePolicyRequest) ProtoReflect() protoreflect.Message
func (*DeletePolicyRequest) Reset ¶
func (x *DeletePolicyRequest) Reset()
func (*DeletePolicyRequest) String ¶
func (x *DeletePolicyRequest) String() string
func (*DeletePolicyRequest) Validate ¶
func (req *DeletePolicyRequest) Validate() error
Validate todo
type DescribePolicyRequest ¶
type DescribePolicyRequest struct { // @gotags: json:"id" Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id"` // contains filtered or unexported fields }
DescribePolicyRequest todo
func NewDescriptPolicyRequest ¶
func NewDescriptPolicyRequest() *DescribePolicyRequest
NewDescriptPolicyRequest new实例
func (*DescribePolicyRequest) Descriptor
deprecated
func (*DescribePolicyRequest) Descriptor() ([]byte, []int)
Deprecated: Use DescribePolicyRequest.ProtoReflect.Descriptor instead.
func (*DescribePolicyRequest) GetId ¶
func (x *DescribePolicyRequest) GetId() string
func (*DescribePolicyRequest) ProtoMessage ¶
func (*DescribePolicyRequest) ProtoMessage()
func (*DescribePolicyRequest) ProtoReflect ¶
func (x *DescribePolicyRequest) ProtoReflect() protoreflect.Message
func (*DescribePolicyRequest) Reset ¶
func (x *DescribePolicyRequest) Reset()
func (*DescribePolicyRequest) String ¶
func (x *DescribePolicyRequest) String() string
func (*DescribePolicyRequest) Validate ¶
func (req *DescribePolicyRequest) Validate() error
Validate todo
type Policy ¶
type Policy struct { // 策略ID // @gotags: bson:"_id" json:"id" Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` // 创建时间 // @gotags: bson:"create_at" json:"create_at" CreateAt int64 `protobuf:"varint,2,opt,name=create_at,json=createAt,proto3" json:"create_at" bson:"create_at"` // 更新时间 // @gotags: bson:"update_at" json:"update_at" UpdateAt int64 `protobuf:"varint,3,opt,name=update_at,json=updateAt,proto3" json:"update_at" bson:"update_at"` // 策略所属域 // @gotags: bson:"domain" json:"domain" Domain string `protobuf:"bytes,4,opt,name=domain,proto3" json:"domain" bson:"domain"` // 创建者ID // @gotags: bson:"creater" json:"creater" Creater string `protobuf:"bytes,5,opt,name=creater,proto3" json:"creater" bson:"creater"` // 用户类型 // @gotags: bson:"user_type" json:"user_type" UserType types.UserType `` /* 131-byte string literal not displayed */ // 范围 // @gotags: bson:"namespace_id" json:"namespace_id" NamespaceId string `protobuf:"bytes,7,opt,name=namespace_id,json=namespaceId,proto3" json:"namespace_id" bson:"namespace_id"` // 用户 // @gotags: bson:"account" json:"account" Account string `protobuf:"bytes,8,opt,name=account,proto3" json:"account" bson:"account"` // 角色名称 // @gotags: bson:"role_id" json:"role_id" RoleId string `protobuf:"bytes,9,opt,name=role_id,json=roleId,proto3" json:"role_id" bson:"role_id"` // 范围控制 // @gotags: bson:"scope" json:"scope" Scope string `protobuf:"bytes,10,opt,name=scope,proto3" json:"scope" bson:"scope"` // 策略过期时间 // @gotags: bson:"expired_time" json:"expired_time" ExpiredTime int64 `protobuf:"varint,11,opt,name=expired_time,json=expiredTime,proto3" json:"expired_time" bson:"expired_time"` // 策略的类型 // @gotags: bson:"type" json:"type" Type PolicyType `protobuf:"varint,12,opt,name=type,proto3,enum=infraboard.keyauth.policy.PolicyType" json:"type" bson:"type"` // 关联的角色对象 // @gotags: bson:"-" json:"role,omitempty" Role *role.Role `protobuf:"bytes,13,opt,name=role,proto3" json:"role,omitempty" bson:"-"` // 关联的空间信息 // @gotags: bson:"-" json:"namespace,omitempty" Namespace *namespace.Namespace `protobuf:"bytes,14,opt,name=namespace,proto3" json:"namespace,omitempty" bson:"-"` // contains filtered or unexported fields }
Policy 权限策略
func (*Policy) CheckDependence ¶
func (p *Policy) CheckDependence(ctx context.Context, u user.ServiceServer, r role.ServiceServer, ns namespace.ServiceServer) (*user.User, error)
CheckDependence todo
func (*Policy) Descriptor
deprecated
func (*Policy) GetAccount ¶
func (*Policy) GetCreateAt ¶
func (*Policy) GetCreater ¶
func (*Policy) GetExpiredTime ¶
func (*Policy) GetNamespace ¶
func (*Policy) GetNamespaceId ¶
func (*Policy) GetType ¶
func (x *Policy) GetType() PolicyType
func (*Policy) GetUpdateAt ¶
func (*Policy) GetUserType ¶
func (*Policy) IsAllNamespace ¶
IsAllNamespace 是否是对账所有namespace的测试
func (*Policy) ProtoMessage ¶
func (*Policy) ProtoMessage()
func (*Policy) ProtoReflect ¶
func (x *Policy) ProtoReflect() protoreflect.Message
type PolicyType ¶
type PolicyType int32
const ( PolicyType_NULL PolicyType = 0 // CustomPolicy (custom) 用户自己定义的策略 PolicyType_CUSTOM PolicyType = 1 // BuildInPolicy (build_in) 系统内部逻辑, 不允许用户看到并修改 PolicyType_BUILD_IN PolicyType = 2 )
func ParsePolicyTypeFromString ¶
func ParsePolicyTypeFromString(str string) (PolicyType, error)
ParsePolicyTypeFromString Parse PolicyType from string
func (PolicyType) Descriptor ¶
func (PolicyType) Descriptor() protoreflect.EnumDescriptor
func (PolicyType) Enum ¶
func (x PolicyType) Enum() *PolicyType
func (PolicyType) EnumDescriptor
deprecated
func (PolicyType) EnumDescriptor() ([]byte, []int)
Deprecated: Use PolicyType.Descriptor instead.
func (PolicyType) Number ¶
func (x PolicyType) Number() protoreflect.EnumNumber
func (PolicyType) String ¶
func (x PolicyType) String() string
func (PolicyType) Type ¶
func (PolicyType) Type() protoreflect.EnumType
func (*PolicyType) UnmarshalJSON ¶
func (t *PolicyType) UnmarshalJSON(b []byte) error
UnmarshalJSON todo
type QueryPolicyRequest ¶
type QueryPolicyRequest struct { // @gotags: bson:"page" json:"page" Page *page.PageRequest `protobuf:"bytes,1,opt,name=page,proto3" json:"page" bson:"page"` // @gotags: json:"account,omitempty" Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty"` // @gotags: json:"role_id,omitempty" RoleId string `protobuf:"bytes,3,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` // @gotags: json:"namespace_id,omitempty" NamespaceId string `protobuf:"bytes,4,opt,name=namespace_id,json=namespaceId,proto3" json:"namespace_id,omitempty"` // @gotags: json:"type,omitempty" Type PolicyType `protobuf:"varint,5,opt,name=type,proto3,enum=infraboard.keyauth.policy.PolicyType" json:"type,omitempty"` // @gotags: json:"with_role,omitempty" WithRole bool `protobuf:"varint,6,opt,name=with_role,json=withRole,proto3" json:"with_role,omitempty"` // @gotags: json:"with_namespace,omitempty" WithNamespace bool `protobuf:"varint,7,opt,name=with_namespace,json=withNamespace,proto3" json:"with_namespace,omitempty"` // @gotags: json:"domain" Domain string `protobuf:"bytes,8,opt,name=domain,proto3" json:"domain"` // contains filtered or unexported fields }
QueryPolicyRequest 获取子账号列表
func NewQueryPolicyRequest ¶
func NewQueryPolicyRequest(pageReq *request.PageRequest) *QueryPolicyRequest
NewQueryPolicyRequest 列表查询请求
func NewQueryPolicyRequestFromHTTP ¶
func NewQueryPolicyRequestFromHTTP(r *http.Request) *QueryPolicyRequest
NewQueryPolicyRequestFromHTTP 列表查询请求
func (*QueryPolicyRequest) CheckOwner ¶
func (req *QueryPolicyRequest) CheckOwner(account string) bool
func (*QueryPolicyRequest) Descriptor
deprecated
func (*QueryPolicyRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryPolicyRequest.ProtoReflect.Descriptor instead.
func (*QueryPolicyRequest) GetAccount ¶
func (x *QueryPolicyRequest) GetAccount() string
func (*QueryPolicyRequest) GetDomain ¶
func (x *QueryPolicyRequest) GetDomain() string
func (*QueryPolicyRequest) GetNamespaceId ¶
func (x *QueryPolicyRequest) GetNamespaceId() string
func (*QueryPolicyRequest) GetPage ¶
func (x *QueryPolicyRequest) GetPage() *page.PageRequest
func (*QueryPolicyRequest) GetRoleId ¶
func (x *QueryPolicyRequest) GetRoleId() string
func (*QueryPolicyRequest) GetType ¶
func (x *QueryPolicyRequest) GetType() PolicyType
func (*QueryPolicyRequest) GetWithNamespace ¶
func (x *QueryPolicyRequest) GetWithNamespace() bool
func (*QueryPolicyRequest) GetWithRole ¶
func (x *QueryPolicyRequest) GetWithRole() bool
func (*QueryPolicyRequest) ProtoMessage ¶
func (*QueryPolicyRequest) ProtoMessage()
func (*QueryPolicyRequest) ProtoReflect ¶
func (x *QueryPolicyRequest) ProtoReflect() protoreflect.Message
func (*QueryPolicyRequest) Reset ¶
func (x *QueryPolicyRequest) Reset()
func (*QueryPolicyRequest) String ¶
func (x *QueryPolicyRequest) String() string
func (*QueryPolicyRequest) Validate ¶
func (req *QueryPolicyRequest) Validate() error
Validate 校验请求是否合法
type ServiceClient ¶ added in v0.6.4
type ServiceClient interface { CreatePolicy(ctx context.Context, in *CreatePolicyRequest, opts ...grpc.CallOption) (*Policy, error) QueryPolicy(ctx context.Context, in *QueryPolicyRequest, opts ...grpc.CallOption) (*Set, error) DescribePolicy(ctx context.Context, in *DescribePolicyRequest, opts ...grpc.CallOption) (*Policy, error) DeletePolicy(ctx context.Context, in *DeletePolicyRequest, opts ...grpc.CallOption) (*Policy, 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 ¶ added in v0.6.4
func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient
type ServiceServer ¶ added in v0.6.4
type ServiceServer interface { CreatePolicy(context.Context, *CreatePolicyRequest) (*Policy, error) QueryPolicy(context.Context, *QueryPolicyRequest) (*Set, error) DescribePolicy(context.Context, *DescribePolicyRequest) (*Policy, error) DeletePolicy(context.Context, *DeletePolicyRequest) (*Policy, 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 []*Policy `protobuf:"bytes,2,rep,name=items,proto3" json:"items" bson:"items"` // contains filtered or unexported fields }
func (*Set) Descriptor
deprecated
func (*Set) GetNamespace ¶
func (*Set) GetNamespaceWithPage ¶
func (s *Set) GetNamespaceWithPage(page *page.PageRequest) (nss []string, total int64)
func (*Set) GetRoles ¶
func (s *Set) GetRoles(ctx context.Context, r role.ServiceServer, withPermission bool) (*role.Set, error)
GetRoles todo
func (*Set) ProtoMessage ¶
func (*Set) ProtoMessage()
func (*Set) ProtoReflect ¶
func (x *Set) ProtoReflect() protoreflect.Message
type UnimplementedServiceServer ¶ added in v0.6.4
type UnimplementedServiceServer struct { }
UnimplementedServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedServiceServer) CreatePolicy ¶ added in v0.6.4
func (UnimplementedServiceServer) CreatePolicy(context.Context, *CreatePolicyRequest) (*Policy, error)
func (UnimplementedServiceServer) DeletePolicy ¶ added in v0.6.4
func (UnimplementedServiceServer) DeletePolicy(context.Context, *DeletePolicyRequest) (*Policy, error)
func (UnimplementedServiceServer) DescribePolicy ¶ added in v0.6.4
func (UnimplementedServiceServer) DescribePolicy(context.Context, *DescribePolicyRequest) (*Policy, error)
func (UnimplementedServiceServer) QueryPolicy ¶ added in v0.6.4
func (UnimplementedServiceServer) QueryPolicy(context.Context, *QueryPolicyRequest) (*Set, error)
type UnsafeServiceServer ¶ added in v0.6.4
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.