models

package
v0.0.0-...-35b7764 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextData

type ContextData struct {
	IsLogged         bool                     // know if user has a session
	User             User                     // data of the user logged in
	VisitedUser      User                     // use only for the home page of user /user it holds the data of the visited user
	ActiveTab        string                   // use to know which active tab in view currently /user
	VisitedUserRepos []Repo                   // use for /user?tab=repositories view, store list of repos.
	VisitedRepo      Repo                     // when visitig /user/repo
	Readme           string                   // readme to be rendered on view if necessary, use on /user, /user/repo and file explorer
	VisitedRepoDir   []map[string]interface{} // the files and directories at a given path
}

type Environment

type Environment struct {
	Production  bool   `mapstructure:"production"`
	GitRoot     string `mapstructure:"git_root"`
	ProjectRoot string `mapstructure:"project_root"` // git server instance of library
	Storage     struct {
		Db    storageEnv `mapstructure:"db"`
		Cache storageEnv `mapstructure:"cache"`
	} `maspstructure:"storage"`
	URLs struct {
		PfpApi  string `mapstructure:"pfp_api"`
		Project string `mapstructure:"project"`
	} `mapstructure:"urls"`
	Email struct {
		Host     string `mapstrcuture:"host"`
		User     string `mapstrcuture:"password"`
		Password string `mapstructure:"password"`
		Port     string `mapstructure:"port"`
	} `mapstructure:"email"`
}

store environment variables on runtime

type Repo

type Repo struct {
	ID          string // unique id within the entire application
	Name        string // unique within the owner's scope
	Description string // description of repo (non git feature)
	Owner       string // owner of the repo, who created it, contains its ID
	Location    string // full site location URL within the system "username/reponame"
	IsPrivate   bool   // to handle read/write permissions

}

type User

type User struct {
	ID                 string     `json:"id"`                 // unique ID within the system
	Name               string     `json:"name"`               // unique within the database
	DisplayName        string     `json:"displayName"`        // a non-unique alias for the user
	Bio                string     `json:"bio:"`               // user description, defaults to ”
	Type               string     `json:"type"`               // user, organization, bot. defaults to user
	Email              string     `json:"email"`              // unique email within the system
	Password           string     `json:"password"`           // hashed and salted password
	AmountRepositories int        `json:"amountRepositories"` // amount of repositories the user has, defaults to 1
	Status             UserStatus `json:"status"`             // type of user
	Picture            string     `json:"picture"`            // profile picture full location URL
	DefaultBranchName  string     `json:"defaultBranchName"`  // the name of the branch that all repos created by user will have
}

type UserStatus

type UserStatus string
const (
	// status of user when account has been created but not verified,
	// it cannnot login in this state.
	UNVERIFIED UserStatus = "unverified"
	// representation of the status of a user when is an activated account.
	// In this state it can do any regular user action.
	ACTIVE UserStatus = "active"
)

Jump to

Keyboard shortcuts

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