Documentation
¶
Overview ¶
Package owncloudsql implements a publiclink share manager backed by an existing ownCloud 10 database
The SQL queries use `coalesce({column_identifier}, ”) as {column_identifier}` to read an emptystring instead of null values, which better fits the golang default values.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(driver string, db *sql.DB, c Config, userConverter UserConverter) (publicshare.Manager, error)
New returns a new Cache instance connecting to the given sql.DB
Types ¶
type Config ¶
type Config struct {
GatewayAddr string `mapstructure:"gateway_addr"`
DbUsername string `mapstructure:"db_username"`
DbPassword string `mapstructure:"db_password"`
DbHost string `mapstructure:"db_host"`
DbPort int `mapstructure:"db_port"`
DbName string `mapstructure:"db_name"`
}
Config configures an owncloudsql publicshare manager
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
Click to show internal directories.
Click to hide internal directories.