Documentation ¶
Index ¶
- func New(driver string, db *sql.DB, storageMountID string, userConverter UserConverter) (share.Manager, error)
- func NewMysql(m map[string]interface{}) (share.Manager, error)
- type DBShare
- type GatewayUserConverter
- func (c *GatewayUserConverter) GetUser(userid *userpb.UserId) (*userpb.User, error)
- func (c *GatewayUserConverter) UserIDToUserName(ctx context.Context, userid *userpb.UserId) (string, error)
- func (c *GatewayUserConverter) UserNameToUserID(ctx context.Context, username string) (*userpb.UserId, error)
- type UserConverter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GatewayUserConverter ¶
type GatewayUserConverter struct { IDCache *ttlcache.Cache NameCache *ttlcache.Cache // contains filtered or unexported fields }
GatewayUserConverter converts usernames and ids using the gateway
func NewGatewayUserConverter ¶
func NewGatewayUserConverter(gwAddr string) *GatewayUserConverter
NewGatewayUserConverter returns a instance of GatewayUserConverter
func (*GatewayUserConverter) UserIDToUserName ¶
func (c *GatewayUserConverter) UserIDToUserName(ctx context.Context, userid *userpb.UserId) (string, error)
UserIDToUserName converts a user ID to an username
func (*GatewayUserConverter) UserNameToUserID ¶
func (c *GatewayUserConverter) UserNameToUserID(ctx context.Context, username string) (*userpb.UserId, error)
UserNameToUserID converts a username to an user ID
type UserConverter ¶
type UserConverter interface { UserNameToUserID(ctx context.Context, username string) (*userpb.UserId, error) UserIDToUserName(ctx context.Context, userid *userpb.UserId) (string, error) GetUser(userid *userpb.UserId) (*userpb.User, error) }
UserConverter describes an interface for converting user ids to names and back
Click to show internal directories.
Click to hide internal directories.