owncloudsql

package
v2.24.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(driver string, db *sql.DB, storageMountID string, userConverter UserConverter) (share.Manager, error)

New returns a new Cache instance connecting to the given sql.DB

func NewMysql

func NewMysql(m map[string]interface{}) (share.Manager, error)

NewMysql returns a new share manager connection to a mysql database

Types

type DBShare

type DBShare struct {
	ID           string
	UIDOwner     string
	UIDInitiator string
	ItemStorage  string
	FileSource   string
	ShareWith    string
	Token        string
	Expiration   string
	Permissions  int
	ShareType    int
	ShareName    string
	STime        int
	FileTarget   string
	RejectedBy   string
	State        int
	Parent       int
}

DBShare stores information about user and public shares.

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) GetUser added in v2.17.0

func (c *GatewayUserConverter) GetUser(userid *userpb.UserId) (*userpb.User, error)

GetUser gets the user

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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