Documentation
¶
Index ¶
Constants ¶
View Source
const ModName = "uuid"
ModName named a mod
Variables ¶
View Source
var ProviderSet = wire.NewSet( NewUuidService, wire.Struct(new(Options), "*"), redisCli.ProviderSet, )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Epoch is set to the twitter snowflake epoch of Nov 04 2010 01:42:54 UTC in milliseconds // You may customize this to set a different epoch for your application. Epoch int64 // NodeBits holds the number of bits to use for Node // Remember, you have a total 22 bits to share between Node/Step NodeBits uint8 // StepBits holds the number of bits to use for Step // Remember, you have a total 22 bits to share between Node/Step StepBits uint8 // NodeID determine the specific value of the node id; 0 nodeID are not used by default NodeID int64 // EnableRedis whether to enable the use of redis to assign node IDs EnableRedis bool // RedisAddr redis addr, default to 'Host:Port' RedisAddr string }
Config uuid service config
type Options ¶
type Options struct { // 没有依赖任何服务,这里就不存在client // UuidGrpc grpc.UuidInterface // ExampleMysql mysql.ExampleInterface Redis redisCli.RedisInterface }
Options wireservice
type Uuid ¶
type Uuid struct { Options // contains filtered or unexported fields }
func (*Uuid) GetUuidByGoogleUUIDV4 ¶
func (u *Uuid) GetUuidByGoogleUUIDV4(ctx context.Context, req *uuidv1.GetUuidByGoogleUUIDV4Request) (*uuidv1.GetUuidByGoogleUUIDV4Response, error)
func (*Uuid) GetUuidBySnowflake ¶
func (u *Uuid) GetUuidBySnowflake(ctx context.Context, req *uuidv1.GetUuidBySnowflakeRequest) (*uuidv1.GetUuidBySnowflakeResponse, error)
Click to show internal directories.
Click to hide internal directories.