Documentation ¶
Index ¶
- func ToCorrectPageSize(size int) int
- func ToGitServiceType(value string) structs.GitServiceType
- func ToPackage(ctx context.Context, pd *packages.PackageDescriptor, doer *user_model.User, ...) (*api.Package, error)
- func ToPackageFile(pfd *packages.PackageFileDescriptor) *api.PackageFile
- func ToUser(ctx context.Context, user, doer *user_model.User) *api.User
- func ToUserAndPermission(ctx context.Context, user, doer *user_model.User, accessMode perm.AccessMode) api.RepoCollaboratorPermission
- func ToUserWithAccessMode(ctx context.Context, user *user_model.User, accessMode perm.AccessMode) *api.User
- func ToUsers(ctx context.Context, doer *user_model.User, users []*user_model.User) []*api.User
- func User2UserSettings(user *user_model.User) api.UserSettings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToCorrectPageSize ¶
ToCorrectPageSize makes sure page size is in allowed range.
func ToGitServiceType ¶
func ToGitServiceType(value string) structs.GitServiceType
ToGitServiceType return GitServiceType based on string
func ToPackage ¶
func ToPackage(ctx context.Context, pd *packages.PackageDescriptor, doer *user_model.User, download_count map[int64]int64) (*api.Package, error)
ToPackage convert a packages.PackageDescriptor to api.Package
func ToPackageFile ¶
func ToPackageFile(pfd *packages.PackageFileDescriptor) *api.PackageFile
ToPackageFile converts packages.PackageFileDescriptor to api.PackageFile
func ToUser ¶
ToUser convert user_model.User to api.User if doer is set, private information is added if the doer has the permission to see it
func ToUserAndPermission ¶
func ToUserAndPermission(ctx context.Context, user, doer *user_model.User, accessMode perm.AccessMode) api.RepoCollaboratorPermission
ToUserAndPermission return User and its collaboration permission for a repository
func ToUserWithAccessMode ¶
func ToUserWithAccessMode(ctx context.Context, user *user_model.User, accessMode perm.AccessMode) *api.User
ToUserWithAccessMode convert user_model.User to api.User AccessMode is not none show add some more information
func ToUsers ¶
func ToUsers(ctx context.Context, doer *user_model.User, users []*user_model.User) []*api.User
ToUsers convert list of user_model.User to list of api.User
func User2UserSettings ¶
func User2UserSettings(user *user_model.User) api.UserSettings
User2UserSettings return UserSettings based on a user
Types ¶
This section is empty.