examplepb

package
v0.0.0-...-05007f7 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserService_GetUser_FullMethodName      = "/example.service.v1.UserService/GetUser"
	UserService_ListUsers_FullMethodName    = "/example.service.v1.UserService/ListUsers"
	UserService_CreateUser_FullMethodName   = "/example.service.v1.UserService/CreateUser"
	UserService_UpdateUser_FullMethodName   = "/example.service.v1.UserService/UpdateUser"
	UserService_DeleteUser_FullMethodName   = "/example.service.v1.UserService/DeleteUser"
	UserService_UndeleteUser_FullMethodName = "/example.service.v1.UserService/UndeleteUser"
)
View Source
const OperationUserServiceCreateUser = "/example.service.v1.UserService/CreateUser"
View Source
const OperationUserServiceDeleteUser = "/example.service.v1.UserService/DeleteUser"
View Source
const OperationUserServiceGetUser = "/example.service.v1.UserService/GetUser"
View Source
const OperationUserServiceListUsers = "/example.service.v1.UserService/ListUsers"
View Source
const OperationUserServiceUndeleteUser = "/example.service.v1.UserService/UndeleteUser"
View Source
const OperationUserServiceUpdateUser = "/example.service.v1.UserService/UpdateUser"

Variables

View Source
var (
	UserErrorReason_name = map[int32]string{
		0: "USER_ERROR_REASON_UNSPECIFIED",
		1: "USER_ERROR_REASON_NOT_FOUND",
		2: "USER_ERROR_REASON_ALREADY_EXISTS",
		3: "USER_ERROR_REASON_ETAG_MISMATCH",
	}
	UserErrorReason_value = map[string]int32{
		"USER_ERROR_REASON_UNSPECIFIED":    0,
		"USER_ERROR_REASON_NOT_FOUND":      1,
		"USER_ERROR_REASON_ALREADY_EXISTS": 2,
		"USER_ERROR_REASON_ETAG_MISMATCH":  3,
	}
)

Enum value maps for UserErrorReason.

View Source
var File_example_service_v1_user_proto protoreflect.FileDescriptor
View Source
var UserFields = struct {
	Name              UserFieldPath
	DisplayName       UserFieldPath
	Email             UserFieldPath
	TenantPlan        UserFieldPath
	Nickname          UserFieldPath
	TemporaryPassword UserFieldPath
	Etag              UserFieldPath
	CreateTime        UserFieldPath
	UpdateTime        UserFieldPath
	DeleteTime        UserFieldPath
	PurgeTime         UserFieldPath
}{
	Name:              UserFieldPath{/* contains filtered or unexported fields */},
	DisplayName:       UserFieldPath{/* contains filtered or unexported fields */},
	Email:             UserFieldPath{/* contains filtered or unexported fields */},
	TenantPlan:        UserFieldPath{/* contains filtered or unexported fields */},
	Nickname:          UserFieldPath{/* contains filtered or unexported fields */},
	TemporaryPassword: UserFieldPath{/* contains filtered or unexported fields */},
	Etag:              UserFieldPath{/* contains filtered or unexported fields */},
	CreateTime:        UserFieldPath{/* contains filtered or unexported fields */},
	UpdateTime:        UserFieldPath{/* contains filtered or unexported fields */},
	DeleteTime:        UserFieldPath{/* contains filtered or unexported fields */},
	PurgeTime:         UserFieldPath{/* contains filtered or unexported fields */},
}

UserFields contains every supported resource field path.

View Source
var UserService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "example.service.v1.UserService",
	HandlerType: (*UserServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetUser",
			Handler:    _UserService_GetUser_Handler,
		},
		{
			MethodName: "ListUsers",
			Handler:    _UserService_ListUsers_Handler,
		},
		{
			MethodName: "CreateUser",
			Handler:    _UserService_CreateUser_Handler,
		},
		{
			MethodName: "UpdateUser",
			Handler:    _UserService_UpdateUser_Handler,
		},
		{
			MethodName: "DeleteUser",
			Handler:    _UserService_DeleteUser_Handler,
		},
		{
			MethodName: "UndeleteUser",
			Handler:    _UserService_UndeleteUser_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "example/service/v1/user.proto",
}

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

Functions

func ErrorUserErrorReasonAlreadyExists

func ErrorUserErrorReasonAlreadyExists(format string, args ...any) *errors.Error

func ErrorUserErrorReasonEtagMismatch

func ErrorUserErrorReasonEtagMismatch(format string, args ...any) *errors.Error

func ErrorUserErrorReasonNotFound

func ErrorUserErrorReasonNotFound(format string, args ...any) *errors.Error

func ErrorUserErrorReasonUnspecified

func ErrorUserErrorReasonUnspecified(format string, args ...any) *errors.Error

func IsUserErrorReasonAlreadyExists

func IsUserErrorReasonAlreadyExists(err error) bool

func IsUserErrorReasonEtagMismatch

func IsUserErrorReasonEtagMismatch(err error) bool

func IsUserErrorReasonNotFound

func IsUserErrorReasonNotFound(err error) bool

func IsUserErrorReasonUnspecified

func IsUserErrorReasonUnspecified(err error) bool

func RegisterUserServiceHTTPServer

func RegisterUserServiceHTTPServer(s *http.Server, srv UserServiceHTTPServer)

func RegisterUserServiceServer

func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer)

func UserCRUDDescriptor

func UserCRUDDescriptor() protoreflect.MessageDescriptor

UserCRUDDescriptor returns the official protobuf descriptor for User.

Types

type CreateUserRequest

type CreateUserRequest struct {

	// parent 是新 User 所属 tenant 的 canonical 资源名。
	Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
	// 成为 User.name 的末段;请求中的 user.name 被忽略。
	UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// user 是待创建的 User;请求中的 name 被忽略。
	User *User `protobuf:"bytes,3,opt,name=user,proto3" json:"user,omitempty"`
	// contains filtered or unexported fields
}

CreateUserRequest 描述创建 User 所需输入。

func (*CreateUserRequest) Descriptor deprecated

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

Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead.

func (*CreateUserRequest) GetParent

func (x *CreateUserRequest) GetParent() string

func (*CreateUserRequest) GetUser

func (x *CreateUserRequest) GetUser() *User

func (*CreateUserRequest) GetUserId

func (x *CreateUserRequest) GetUserId() string

func (*CreateUserRequest) ProtoMessage

func (*CreateUserRequest) ProtoMessage()

func (*CreateUserRequest) ProtoReflect

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

func (*CreateUserRequest) Reset

func (x *CreateUserRequest) Reset()

func (*CreateUserRequest) String

func (x *CreateUserRequest) String() string

func (*CreateUserRequest) Validate

func (m *CreateUserRequest) Validate() error

Validate checks the field values on CreateUserRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*CreateUserRequest) ValidateAll

func (m *CreateUserRequest) ValidateAll() error

ValidateAll checks the field values on CreateUserRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in CreateUserRequestMultiError, or nil if none found.

type CreateUserRequestMultiError

type CreateUserRequestMultiError []error

CreateUserRequestMultiError is an error wrapping multiple validation errors returned by CreateUserRequest.ValidateAll() if the designated constraints aren't met.

func (CreateUserRequestMultiError) AllErrors

func (m CreateUserRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CreateUserRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type CreateUserRequestValidationError

type CreateUserRequestValidationError struct {
	// contains filtered or unexported fields
}

CreateUserRequestValidationError is the validation error returned by CreateUserRequest.Validate if the designated constraints aren't met.

func (CreateUserRequestValidationError) Cause

Cause function returns cause value.

func (CreateUserRequestValidationError) Error

Error satisfies the builtin error interface

func (CreateUserRequestValidationError) ErrorName

ErrorName returns error name.

func (CreateUserRequestValidationError) Field

Field function returns field value.

func (CreateUserRequestValidationError) Key

Key function returns key value.

func (CreateUserRequestValidationError) Reason

Reason function returns reason value.

type DeleteUserRequest

type DeleteUserRequest struct {

	// name 是待删除 User 的 canonical 资源名。
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// etag 非空时要求与当前资源一致。
	Etag string `protobuf:"bytes,2,opt,name=etag,proto3" json:"etag,omitempty"`
	// allow_missing 为 true 时删除不存在资源可由业务返回幂等结果。
	AllowMissing bool `protobuf:"varint,3,opt,name=allow_missing,json=allowMissing,proto3" json:"allow_missing,omitempty"`
	// contains filtered or unexported fields
}

DeleteUserRequest 按 canonical 资源名定位待删除 User。

func (*DeleteUserRequest) Descriptor deprecated

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

Deprecated: Use DeleteUserRequest.ProtoReflect.Descriptor instead.

func (*DeleteUserRequest) GetAllowMissing

func (x *DeleteUserRequest) GetAllowMissing() bool

func (*DeleteUserRequest) GetEtag

func (x *DeleteUserRequest) GetEtag() string

func (*DeleteUserRequest) GetName

func (x *DeleteUserRequest) GetName() string

func (*DeleteUserRequest) ProtoMessage

func (*DeleteUserRequest) ProtoMessage()

func (*DeleteUserRequest) ProtoReflect

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

func (*DeleteUserRequest) Reset

func (x *DeleteUserRequest) Reset()

func (*DeleteUserRequest) String

func (x *DeleteUserRequest) String() string

func (*DeleteUserRequest) Validate

func (m *DeleteUserRequest) Validate() error

Validate checks the field values on DeleteUserRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*DeleteUserRequest) ValidateAll

func (m *DeleteUserRequest) ValidateAll() error

ValidateAll checks the field values on DeleteUserRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in DeleteUserRequestMultiError, or nil if none found.

type DeleteUserRequestMultiError

type DeleteUserRequestMultiError []error

DeleteUserRequestMultiError is an error wrapping multiple validation errors returned by DeleteUserRequest.ValidateAll() if the designated constraints aren't met.

func (DeleteUserRequestMultiError) AllErrors

func (m DeleteUserRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (DeleteUserRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type DeleteUserRequestValidationError

type DeleteUserRequestValidationError struct {
	// contains filtered or unexported fields
}

DeleteUserRequestValidationError is the validation error returned by DeleteUserRequest.Validate if the designated constraints aren't met.

func (DeleteUserRequestValidationError) Cause

Cause function returns cause value.

func (DeleteUserRequestValidationError) Error

Error satisfies the builtin error interface

func (DeleteUserRequestValidationError) ErrorName

ErrorName returns error name.

func (DeleteUserRequestValidationError) Field

Field function returns field value.

func (DeleteUserRequestValidationError) Key

Key function returns key value.

func (DeleteUserRequestValidationError) Reason

Reason function returns reason value.

type GetUserRequest

type GetUserRequest struct {

	// name 是待获取 User 的 canonical 资源名。
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

GetUserRequest 按 canonical 资源名定位 User。

func (*GetUserRequest) Descriptor deprecated

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

Deprecated: Use GetUserRequest.ProtoReflect.Descriptor instead.

func (*GetUserRequest) GetName

func (x *GetUserRequest) GetName() string

func (*GetUserRequest) ProtoMessage

func (*GetUserRequest) ProtoMessage()

func (*GetUserRequest) ProtoReflect

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

func (*GetUserRequest) Reset

func (x *GetUserRequest) Reset()

func (*GetUserRequest) String

func (x *GetUserRequest) String() string

func (*GetUserRequest) Validate

func (m *GetUserRequest) Validate() error

Validate checks the field values on GetUserRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*GetUserRequest) ValidateAll

func (m *GetUserRequest) ValidateAll() error

ValidateAll checks the field values on GetUserRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in GetUserRequestMultiError, or nil if none found.

type GetUserRequestMultiError

type GetUserRequestMultiError []error

GetUserRequestMultiError is an error wrapping multiple validation errors returned by GetUserRequest.ValidateAll() if the designated constraints aren't met.

func (GetUserRequestMultiError) AllErrors

func (m GetUserRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetUserRequestMultiError) Error

func (m GetUserRequestMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type GetUserRequestValidationError

type GetUserRequestValidationError struct {
	// contains filtered or unexported fields
}

GetUserRequestValidationError is the validation error returned by GetUserRequest.Validate if the designated constraints aren't met.

func (GetUserRequestValidationError) Cause

Cause function returns cause value.

func (GetUserRequestValidationError) Error

Error satisfies the builtin error interface

func (GetUserRequestValidationError) ErrorName

func (e GetUserRequestValidationError) ErrorName() string

ErrorName returns error name.

func (GetUserRequestValidationError) Field

Field function returns field value.

func (GetUserRequestValidationError) Key

Key function returns key value.

func (GetUserRequestValidationError) Reason

Reason function returns reason value.

type ListUsersRequest

type ListUsersRequest struct {

	// parent 是待查询 User collection 的 tenant 资源名。
	Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
	// page_size 是服务端最多返回的资源数量。
	PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	// page_token 是前一页返回的不透明连续翻页令牌。
	PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
	// 可单独使用,也可在 page_token 恢复 cursor 后额外跳过资源;服务可以限制最大值。
	// Servora 的随机跳页扩展;项目 api-linter 配置明示允许该字段。
	// (-- api-linter: core::0158::request-skip-field=disabled --)
	Skip int64 `protobuf:"varint,4,opt,name=skip,proto3" json:"skip,omitempty"`
	// filter 是 AIP-160 确定性子集表达式。
	Filter string `protobuf:"bytes,5,opt,name=filter,proto3" json:"filter,omitempty"`
	// order_by 是 AIP-132 排序表达式。
	OrderBy string `protobuf:"bytes,6,opt,name=order_by,json=orderBy,proto3" json:"order_by,omitempty"`
	// 只有 true 时执行 Count 并返回 total_size。
	// Servora 的可选 total 扩展;项目 api-linter 配置需允许该附加字段。
	// (-- api-linter: core::0132::request-unknown-fields=disabled --)
	IncludeTotal bool `protobuf:"varint,7,opt,name=include_total,json=includeTotal,proto3" json:"include_total,omitempty"`
	// true 时显式包含正常资源与 tombstone;默认只返回正常资源。
	ShowDeleted bool `protobuf:"varint,8,opt,name=show_deleted,json=showDeleted,proto3" json:"show_deleted,omitempty"`
	// contains filtered or unexported fields
}

ListUsersRequest 描述一个标准 User 集合查询。

func (*ListUsersRequest) Descriptor deprecated

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

Deprecated: Use ListUsersRequest.ProtoReflect.Descriptor instead.

func (*ListUsersRequest) GetFilter

func (x *ListUsersRequest) GetFilter() string

func (*ListUsersRequest) GetIncludeTotal

func (x *ListUsersRequest) GetIncludeTotal() bool

func (*ListUsersRequest) GetOrderBy

func (x *ListUsersRequest) GetOrderBy() string

func (*ListUsersRequest) GetPageSize

func (x *ListUsersRequest) GetPageSize() int32

func (*ListUsersRequest) GetPageToken

func (x *ListUsersRequest) GetPageToken() string

func (*ListUsersRequest) GetParent

func (x *ListUsersRequest) GetParent() string

func (*ListUsersRequest) GetShowDeleted

func (x *ListUsersRequest) GetShowDeleted() bool

func (*ListUsersRequest) GetSkip

func (x *ListUsersRequest) GetSkip() int64

func (*ListUsersRequest) ProtoMessage

func (*ListUsersRequest) ProtoMessage()

func (*ListUsersRequest) ProtoReflect

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

func (*ListUsersRequest) Reset

func (x *ListUsersRequest) Reset()

func (*ListUsersRequest) String

func (x *ListUsersRequest) String() string

func (*ListUsersRequest) Validate

func (m *ListUsersRequest) Validate() error

Validate checks the field values on ListUsersRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ListUsersRequest) ValidateAll

func (m *ListUsersRequest) ValidateAll() error

ValidateAll checks the field values on ListUsersRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ListUsersRequestMultiError, or nil if none found.

type ListUsersRequestMultiError

type ListUsersRequestMultiError []error

ListUsersRequestMultiError is an error wrapping multiple validation errors returned by ListUsersRequest.ValidateAll() if the designated constraints aren't met.

func (ListUsersRequestMultiError) AllErrors

func (m ListUsersRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ListUsersRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type ListUsersRequestValidationError

type ListUsersRequestValidationError struct {
	// contains filtered or unexported fields
}

ListUsersRequestValidationError is the validation error returned by ListUsersRequest.Validate if the designated constraints aren't met.

func (ListUsersRequestValidationError) Cause

Cause function returns cause value.

func (ListUsersRequestValidationError) Error

Error satisfies the builtin error interface

func (ListUsersRequestValidationError) ErrorName

ErrorName returns error name.

func (ListUsersRequestValidationError) Field

Field function returns field value.

func (ListUsersRequestValidationError) Key

Key function returns key value.

func (ListUsersRequestValidationError) Reason

Reason function returns reason value.

type ListUsersResponse

type ListUsersResponse struct {

	// users 是当前页返回的 User 列表。
	Users []*User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"`
	// next_page_token 是下一页的不透明连续翻页令牌;末页为空。
	NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
	// 仅在 include_total 为 true 时设置。Servora 明示使用 optional int64
	// 表达“未计算”并支持大型集合。
	// Servora 的可选 total 扩展;项目 api-linter 配置明示允许该字段。
	// (-- api-linter: core::0132::response-unknown-fields=disabled --)
	TotalSize *int64 `protobuf:"varint,3,opt,name=total_size,json=totalSize,proto3,oneof" json:"total_size,omitempty"`
	// contains filtered or unexported fields
}

ListUsersResponse 包含一页 User 及分页元数据。

func (*ListUsersResponse) Descriptor deprecated

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

Deprecated: Use ListUsersResponse.ProtoReflect.Descriptor instead.

func (*ListUsersResponse) GetNextPageToken

func (x *ListUsersResponse) GetNextPageToken() string

func (*ListUsersResponse) GetTotalSize

func (x *ListUsersResponse) GetTotalSize() int64

func (*ListUsersResponse) GetUsers

func (x *ListUsersResponse) GetUsers() []*User

func (*ListUsersResponse) ProtoMessage

func (*ListUsersResponse) ProtoMessage()

func (*ListUsersResponse) ProtoReflect

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

func (*ListUsersResponse) Reset

func (x *ListUsersResponse) Reset()

func (*ListUsersResponse) String

func (x *ListUsersResponse) String() string

func (*ListUsersResponse) Validate

func (m *ListUsersResponse) Validate() error

Validate checks the field values on ListUsersResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ListUsersResponse) ValidateAll

func (m *ListUsersResponse) ValidateAll() error

ValidateAll checks the field values on ListUsersResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ListUsersResponseMultiError, or nil if none found.

type ListUsersResponseMultiError

type ListUsersResponseMultiError []error

ListUsersResponseMultiError is an error wrapping multiple validation errors returned by ListUsersResponse.ValidateAll() if the designated constraints aren't met.

func (ListUsersResponseMultiError) AllErrors

func (m ListUsersResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ListUsersResponseMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type ListUsersResponseValidationError

type ListUsersResponseValidationError struct {
	// contains filtered or unexported fields
}

ListUsersResponseValidationError is the validation error returned by ListUsersResponse.Validate if the designated constraints aren't met.

func (ListUsersResponseValidationError) Cause

Cause function returns cause value.

func (ListUsersResponseValidationError) Error

Error satisfies the builtin error interface

func (ListUsersResponseValidationError) ErrorName

ErrorName returns error name.

func (ListUsersResponseValidationError) Field

Field function returns field value.

func (ListUsersResponseValidationError) Key

Key function returns key value.

func (ListUsersResponseValidationError) Reason

Reason function returns reason value.

type UndeleteUserRequest

type UndeleteUserRequest struct {

	// name 是待恢复 User 的 canonical 资源名。
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

UndeleteUserRequest 按 canonical 资源名定位待恢复 User。

func (*UndeleteUserRequest) Descriptor deprecated

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

Deprecated: Use UndeleteUserRequest.ProtoReflect.Descriptor instead.

func (*UndeleteUserRequest) GetName

func (x *UndeleteUserRequest) GetName() string

func (*UndeleteUserRequest) ProtoMessage

func (*UndeleteUserRequest) ProtoMessage()

func (*UndeleteUserRequest) ProtoReflect

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

func (*UndeleteUserRequest) Reset

func (x *UndeleteUserRequest) Reset()

func (*UndeleteUserRequest) String

func (x *UndeleteUserRequest) String() string

func (*UndeleteUserRequest) Validate

func (m *UndeleteUserRequest) Validate() error

Validate checks the field values on UndeleteUserRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*UndeleteUserRequest) ValidateAll

func (m *UndeleteUserRequest) ValidateAll() error

ValidateAll checks the field values on UndeleteUserRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in UndeleteUserRequestMultiError, or nil if none found.

type UndeleteUserRequestMultiError

type UndeleteUserRequestMultiError []error

UndeleteUserRequestMultiError is an error wrapping multiple validation errors returned by UndeleteUserRequest.ValidateAll() if the designated constraints aren't met.

func (UndeleteUserRequestMultiError) AllErrors

func (m UndeleteUserRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (UndeleteUserRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type UndeleteUserRequestValidationError

type UndeleteUserRequestValidationError struct {
	// contains filtered or unexported fields
}

UndeleteUserRequestValidationError is the validation error returned by UndeleteUserRequest.Validate if the designated constraints aren't met.

func (UndeleteUserRequestValidationError) Cause

Cause function returns cause value.

func (UndeleteUserRequestValidationError) Error

Error satisfies the builtin error interface

func (UndeleteUserRequestValidationError) ErrorName

ErrorName returns error name.

func (UndeleteUserRequestValidationError) Field

Field function returns field value.

func (UndeleteUserRequestValidationError) Key

Key function returns key value.

func (UndeleteUserRequestValidationError) Reason

Reason function returns reason value.

type UnimplementedUserServiceServer

type UnimplementedUserServiceServer struct{}

UnimplementedUserServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedUserServiceServer) CreateUser

func (UnimplementedUserServiceServer) DeleteUser

func (UnimplementedUserServiceServer) GetUser

func (UnimplementedUserServiceServer) ListUsers

func (UnimplementedUserServiceServer) UndeleteUser

func (UnimplementedUserServiceServer) UpdateUser

type UnsafeUserServiceServer

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

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

type UpdateUserRequest

type UpdateUserRequest struct {

	// user.name 定位待更新资源。
	User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
	// update_mask 选择待更新字段;省略时按标准隐式 mask 处理。
	UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
	// allow_missing 允许业务按 AIP-134 执行 upsert。
	AllowMissing bool `protobuf:"varint,3,opt,name=allow_missing,json=allowMissing,proto3" json:"allow_missing,omitempty"`
	// contains filtered or unexported fields
}

UpdateUserRequest 描述 User 更新及其字段选择。

func (*UpdateUserRequest) Descriptor deprecated

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

Deprecated: Use UpdateUserRequest.ProtoReflect.Descriptor instead.

func (*UpdateUserRequest) GetAllowMissing

func (x *UpdateUserRequest) GetAllowMissing() bool

func (*UpdateUserRequest) GetUpdateMask

func (x *UpdateUserRequest) GetUpdateMask() *fieldmaskpb.FieldMask

func (*UpdateUserRequest) GetUser

func (x *UpdateUserRequest) GetUser() *User

func (*UpdateUserRequest) ProtoMessage

func (*UpdateUserRequest) ProtoMessage()

func (*UpdateUserRequest) ProtoReflect

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

func (*UpdateUserRequest) Reset

func (x *UpdateUserRequest) Reset()

func (*UpdateUserRequest) String

func (x *UpdateUserRequest) String() string

func (*UpdateUserRequest) Validate

func (m *UpdateUserRequest) Validate() error

Validate checks the field values on UpdateUserRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*UpdateUserRequest) ValidateAll

func (m *UpdateUserRequest) ValidateAll() error

ValidateAll checks the field values on UpdateUserRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in UpdateUserRequestMultiError, or nil if none found.

type UpdateUserRequestMultiError

type UpdateUserRequestMultiError []error

UpdateUserRequestMultiError is an error wrapping multiple validation errors returned by UpdateUserRequest.ValidateAll() if the designated constraints aren't met.

func (UpdateUserRequestMultiError) AllErrors

func (m UpdateUserRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (UpdateUserRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type UpdateUserRequestValidationError

type UpdateUserRequestValidationError struct {
	// contains filtered or unexported fields
}

UpdateUserRequestValidationError is the validation error returned by UpdateUserRequest.Validate if the designated constraints aren't met.

func (UpdateUserRequestValidationError) Cause

Cause function returns cause value.

func (UpdateUserRequestValidationError) Error

Error satisfies the builtin error interface

func (UpdateUserRequestValidationError) ErrorName

ErrorName returns error name.

func (UpdateUserRequestValidationError) Field

Field function returns field value.

func (UpdateUserRequestValidationError) Key

Key function returns key value.

func (UpdateUserRequestValidationError) Reason

Reason function returns reason value.

type User

type User struct {

	// name 是 User 的 canonical AIP 资源名。
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// display_name 是调用方可修改的显示名称;显式 Clear 写入空字符串。
	DisplayName *string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3,oneof" json:"display_name,omitempty"`
	// email 是创建 User 时必须提供且非空的电子邮箱。
	Email *string `protobuf:"bytes,3,opt,name=email,proto3,oneof" json:"email,omitempty"`
	// tenant_plan 是创建后不可修改的租户套餐快照。
	TenantPlan *string `protobuf:"bytes,4,opt,name=tenant_plan,json=tenantPlan,proto3,oneof" json:"tenant_plan,omitempty"`
	// nickname 保留 presence;显式 Clear 写入 NULL。
	Nickname *string `protobuf:"bytes,5,opt,name=nickname,proto3,oneof" json:"nickname,omitempty"`
	// temporary_password 只供 Create/Update 输入;存储层转换为私有 password_hash。
	TemporaryPassword *string `protobuf:"bytes,6,opt,name=temporary_password,json=temporaryPassword,proto3,oneof" json:"temporary_password,omitempty"`
	// etag 是服务端并发控制值;生命周期由业务显式处理。
	Etag string `protobuf:"bytes,7,opt,name=etag,proto3" json:"etag,omitempty"`
	// create_time 是服务端记录的创建时间。
	CreateTime *timestamppb.Timestamp `protobuf:"bytes,100,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
	// update_time 是服务端记录的最近更新时间。
	UpdateTime *timestamppb.Timestamp `protobuf:"bytes,101,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
	// delete_time 是软删除发生时间;未删除时为空。
	DeleteTime *timestamppb.Timestamp `protobuf:"bytes,102,opt,name=delete_time,json=deleteTime,proto3" json:"delete_time,omitempty"`
	// purge_time 是计划物理清除时间;本示例无限期保留,因此可一直为空。
	PurgeTime *timestamppb.Timestamp `protobuf:"bytes,103,opt,name=purge_time,json=purgeTime,proto3" json:"purge_time,omitempty"`
	// contains filtered or unexported fields
}

User 表示 tenant 下的公开用户资源。

func (*User) Descriptor deprecated

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

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetCreateTime

func (x *User) GetCreateTime() *timestamppb.Timestamp

func (*User) GetDeleteTime

func (x *User) GetDeleteTime() *timestamppb.Timestamp

func (*User) GetDisplayName

func (x *User) GetDisplayName() string

func (*User) GetEmail

func (x *User) GetEmail() string

func (*User) GetEtag

func (x *User) GetEtag() string

func (*User) GetName

func (x *User) GetName() string

func (*User) GetNickname

func (x *User) GetNickname() string

func (*User) GetPurgeTime

func (x *User) GetPurgeTime() *timestamppb.Timestamp

func (*User) GetTemporaryPassword

func (x *User) GetTemporaryPassword() string

func (*User) GetTenantPlan

func (x *User) GetTenantPlan() string

func (*User) GetUpdateTime

func (x *User) GetUpdateTime() *timestamppb.Timestamp

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) ProtoReflect

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

func (*User) Reset

func (x *User) Reset()

func (*User) String

func (x *User) String() string

func (*User) Validate

func (m *User) Validate() error

Validate checks the field values on User with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*User) ValidateAll

func (m *User) ValidateAll() error

ValidateAll checks the field values on User with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in UserMultiError, or nil if none found.

type UserErrorReason

type UserErrorReason int32

UserErrorReason contains application-owned User business failures.

const (
	UserErrorReason_USER_ERROR_REASON_UNSPECIFIED    UserErrorReason = 0
	UserErrorReason_USER_ERROR_REASON_NOT_FOUND      UserErrorReason = 1
	UserErrorReason_USER_ERROR_REASON_ALREADY_EXISTS UserErrorReason = 2
	UserErrorReason_USER_ERROR_REASON_ETAG_MISMATCH  UserErrorReason = 3
)

func (UserErrorReason) Descriptor

func (UserErrorReason) Enum

func (x UserErrorReason) Enum() *UserErrorReason

func (UserErrorReason) EnumDescriptor deprecated

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

Deprecated: Use UserErrorReason.Descriptor instead.

func (UserErrorReason) Number

func (UserErrorReason) String

func (x UserErrorReason) String() string

func (UserErrorReason) Type

type UserFieldPath

type UserFieldPath struct {
	// contains filtered or unexported fields
}

UserFieldPath identifies one canonical protobuf field path and resolves its leaf descriptor lazily.

func (UserFieldPath) Descriptor

func (path UserFieldPath) Descriptor() protoreflect.FieldDescriptor

Descriptor returns the path leaf descriptor.

func (UserFieldPath) String

func (path UserFieldPath) String() string

String returns the canonical protobuf snake_case path.

type UserMultiError

type UserMultiError []error

UserMultiError is an error wrapping multiple validation errors returned by User.ValidateAll() if the designated constraints aren't met.

func (UserMultiError) AllErrors

func (m UserMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (UserMultiError) Error

func (m UserMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type UserName

type UserName struct {
	Tenant string
	User   string
}

UserName is the typed parts value for a canonical User resource name.

func NewUserName

func NewUserName(tenant string, user string) UserName

NewUserName constructs the parts for pattern "tenants/{tenant}/users/{user}".

func ParseUserName

func ParseUserName(value string) (UserName, error)

ParseUserName parses one canonical resource name.

func (UserName) Format

func (name UserName) Format() (string, error)

Format validates and formats an unescaped canonical relative resource name.

func (UserName) Validate

func (name UserName) Validate() error

Validate checks the selected pattern and all variable segments.

type UserServiceClient

type UserServiceClient interface {
	GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*User, error)
	ListUsers(ctx context.Context, in *ListUsersRequest, opts ...grpc.CallOption) (*ListUsersResponse, error)
	CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*User, error)
	UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*User, error)
	DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*User, error)
	UndeleteUser(ctx context.Context, in *UndeleteUserRequest, opts ...grpc.CallOption) (*User, error)
}

UserServiceClient is the client API for UserService 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.

UserService exposes the User CRUD reference flow over gRPC and HTTP.

type UserServiceHTTPClient

type UserServiceHTTPClient interface {
	CreateUser(ctx context.Context, req *CreateUserRequest, opts ...http.CallOption) (rsp *User, err error)
	DeleteUser(ctx context.Context, req *DeleteUserRequest, opts ...http.CallOption) (rsp *User, err error)
	GetUser(ctx context.Context, req *GetUserRequest, opts ...http.CallOption) (rsp *User, err error)
	ListUsers(ctx context.Context, req *ListUsersRequest, opts ...http.CallOption) (rsp *ListUsersResponse, err error)
	UndeleteUser(ctx context.Context, req *UndeleteUserRequest, opts ...http.CallOption) (rsp *User, err error)
	UpdateUser(ctx context.Context, req *UpdateUserRequest, opts ...http.CallOption) (rsp *User, err error)
}

func NewUserServiceHTTPClient

func NewUserServiceHTTPClient(client *http.Client) UserServiceHTTPClient

type UserServiceHTTPClientImpl

type UserServiceHTTPClientImpl struct {
	// contains filtered or unexported fields
}

func (*UserServiceHTTPClientImpl) CreateUser

func (c *UserServiceHTTPClientImpl) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...http.CallOption) (*User, error)

func (*UserServiceHTTPClientImpl) DeleteUser

func (c *UserServiceHTTPClientImpl) DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...http.CallOption) (*User, error)

func (*UserServiceHTTPClientImpl) GetUser

func (*UserServiceHTTPClientImpl) ListUsers

func (*UserServiceHTTPClientImpl) UndeleteUser

func (c *UserServiceHTTPClientImpl) UndeleteUser(ctx context.Context, in *UndeleteUserRequest, opts ...http.CallOption) (*User, error)

func (*UserServiceHTTPClientImpl) UpdateUser

func (c *UserServiceHTTPClientImpl) UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...http.CallOption) (*User, error)

type UserServiceHTTPServer

type UserServiceHTTPServer interface {
	CreateUser(context.Context, *CreateUserRequest) (*User, error)
	DeleteUser(context.Context, *DeleteUserRequest) (*User, error)
	GetUser(context.Context, *GetUserRequest) (*User, error)
	ListUsers(context.Context, *ListUsersRequest) (*ListUsersResponse, error)
	UndeleteUser(context.Context, *UndeleteUserRequest) (*User, error)
	UpdateUser(context.Context, *UpdateUserRequest) (*User, error)
}

type UserServiceServer

type UserServiceServer interface {
	GetUser(context.Context, *GetUserRequest) (*User, error)
	ListUsers(context.Context, *ListUsersRequest) (*ListUsersResponse, error)
	CreateUser(context.Context, *CreateUserRequest) (*User, error)
	UpdateUser(context.Context, *UpdateUserRequest) (*User, error)
	DeleteUser(context.Context, *DeleteUserRequest) (*User, error)
	UndeleteUser(context.Context, *UndeleteUserRequest) (*User, error)
	// contains filtered or unexported methods
}

UserServiceServer is the server API for UserService service. All implementations must embed UnimplementedUserServiceServer for forward compatibility.

UserService exposes the User CRUD reference flow over gRPC and HTTP.

type UserValidationError

type UserValidationError struct {
	// contains filtered or unexported fields
}

UserValidationError is the validation error returned by User.Validate if the designated constraints aren't met.

func (UserValidationError) Cause

func (e UserValidationError) Cause() error

Cause function returns cause value.

func (UserValidationError) Error

func (e UserValidationError) Error() string

Error satisfies the builtin error interface

func (UserValidationError) ErrorName

func (e UserValidationError) ErrorName() string

ErrorName returns error name.

func (UserValidationError) Field

func (e UserValidationError) Field() string

Field function returns field value.

func (UserValidationError) Key

func (e UserValidationError) Key() bool

Key function returns key value.

func (UserValidationError) Reason

func (e UserValidationError) Reason() string

Reason function returns reason value.

Jump to

Keyboard shortcuts

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