model

package
v0.0.0-...-fefde71 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_domain_user_model_user_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Account

type Account struct {

	// ID is the unique identifier of the user account.
	// @gotags: bson:"_id"
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" bson:"_id"`
	// Username is the username of the user.
	// @gotags: bson:"username"
	Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty" bson:"username"`
	// Email is the email address of the user.
	// @gotags: bson:"email"
	Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty" bson:"email"`
	// Password is the password of the user.
	// @gotags: json:"-" bson:"password"
	Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"-" bson:"password"`
	// AccessToken is the access token of the user.
	// @gotags: bson:"-"
	AccessToken string `protobuf:"bytes,12,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty" bson:"-"`
	// Address is the address of the user.
	// @gotags: bson:"address"
	Address *Address `protobuf:"bytes,5,opt,name=address,proto3" json:"address,omitempty" bson:"address"`
	// IsActive is the status of the user account.
	// @gotags: bson:"is_active"
	IsActive bool `protobuf:"varint,6,opt,name=is_active,json=isActive,proto3" json:"is_active,omitempty" bson:"is_active"`
	// Level is the access level of the user account.
	// @gotags: bson:"level"
	Level uint32 `protobuf:"varint,7,opt,name=Level,proto3" json:"Level,omitempty" bson:"level"`
	// Roles is the list of roles assigned to the user.
	// @gotags: bson:"roles"
	Roles []*Role `protobuf:"bytes,8,rep,name=roles,proto3" json:"roles,omitempty" bson:"roles"`
	// SocialIDMap is the map of social IDs of the user.
	// @gotags: bson:"social_id_map"
	SocialIDMap map[string]string `` /* 184-byte string literal not displayed */
	// CreatedAt is the creation time of the user account.
	// @gotags: bson:"created_at"
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty" bson:"created_at"`
	// UpdatedAt is the update time of the user account.
	// @gotags: bson:"updated_at"
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty" bson:"updated_at"`
	// contains filtered or unexported fields
}

Account is an entity that represents a user account.

func FromContext

func FromContext(c context.Context) (*Account, error)

FromContext extracts the user from the context.

func (*Account) Descriptor deprecated

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

Deprecated: Use Account.ProtoReflect.Descriptor instead.

func (*Account) GetAccessToken

func (x *Account) GetAccessToken() string

func (*Account) GetAddress

func (x *Account) GetAddress() *Address

func (*Account) GetCreatedAt

func (x *Account) GetCreatedAt() *timestamppb.Timestamp

func (*Account) GetEmail

func (x *Account) GetEmail() string

func (*Account) GetID

func (x *Account) GetID() string

func (*Account) GetId

func (x *Account) GetId() string

func (*Account) GetIsActive

func (x *Account) GetIsActive() bool

func (*Account) GetLevel

func (x *Account) GetLevel() uint32

func (*Account) GetPassword

func (x *Account) GetPassword() string

func (*Account) GetRoles

func (x *Account) GetRoles() []*Role

func (*Account) GetSocialIDMap

func (x *Account) GetSocialIDMap() map[string]string

func (*Account) GetUpdatedAt

func (x *Account) GetUpdatedAt() *timestamppb.Timestamp

func (*Account) GetUsername

func (x *Account) GetUsername() string

func (*Account) ProtoMessage

func (*Account) ProtoMessage()

func (*Account) ProtoReflect

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

func (*Account) Reset

func (x *Account) Reset()

func (*Account) SetCreatedAt

func (x *Account) SetCreatedAt(t *timestamppb.Timestamp)

func (*Account) SetID

func (x *Account) SetID(id primitive.ObjectID)

func (*Account) SetInContext

func (x *Account) SetInContext(c context.Context) context.Context

SetInContext sets the user in the context.

func (*Account) SetUpdatedAt

func (x *Account) SetUpdatedAt(t *timestamppb.Timestamp)

func (*Account) String

func (x *Account) String() string

type Address

type Address struct {

	// Street is the street address of the user.
	// @gotags: bson:"street"
	Street string `protobuf:"bytes,1,opt,name=street,proto3" json:"street,omitempty" bson:"street"`
	// City is the city where the user is located.
	// @gotags: bson:"city"
	City string `protobuf:"bytes,2,opt,name=city,proto3" json:"city,omitempty" bson:"city"`
	// State is the state where the user is located.
	// @gotags: bson:"state"
	State string `protobuf:"bytes,3,opt,name=state,proto3" json:"state,omitempty" bson:"state"`
	// ZipCode is the postal code of the user's location.
	// @gotags: bson:"zip_code"
	ZipCode string `protobuf:"bytes,4,opt,name=zip_code,json=zipCode,proto3" json:"zip_code,omitempty" bson:"zip_code"`
	// contains filtered or unexported fields
}

Address is a value object that represents the address of a user.

func (*Address) Descriptor deprecated

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

Deprecated: Use Address.ProtoReflect.Descriptor instead.

func (*Address) GetCity

func (x *Address) GetCity() string

func (*Address) GetState

func (x *Address) GetState() string

func (*Address) GetStreet

func (x *Address) GetStreet() string

func (*Address) GetZipCode

func (x *Address) GetZipCode() string

func (*Address) ProtoMessage

func (*Address) ProtoMessage()

func (*Address) ProtoReflect

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

func (*Address) Reset

func (x *Address) Reset()

func (*Address) String

func (x *Address) String() string

type Role

type Role struct {

	// ID is the unique identifier of the role.
	// @gotags: bson:"_id"
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" bson:"_id"`
	// Name is the name of the role.
	// @gotags: bson:"name"
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty" bson:"name"`
	// contains filtered or unexported fields
}

Role is an entity that represents the role of a user.

func (*Role) Descriptor deprecated

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

Deprecated: Use Role.ProtoReflect.Descriptor instead.

func (*Role) GetId

func (x *Role) GetId() string

func (*Role) GetName

func (x *Role) GetName() string

func (*Role) ProtoMessage

func (*Role) ProtoMessage()

func (*Role) ProtoReflect

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

func (*Role) Reset

func (x *Role) Reset()

func (*Role) String

func (x *Role) String() string

Jump to

Keyboard shortcuts

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