convert

package
v0.0.0-...-495e01f Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToCorrectPageSize

func ToCorrectPageSize(size int) int

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

func ToUser(ctx context.Context, user, doer *user_model.User) *api.User

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.

Jump to

Keyboard shortcuts

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