models

package
v0.0.0-...-b595b4b Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupDatabase

func SetupDatabase()

SetupDatabase will init a sqlite3 database and sync all models

Types

type Issue

type Issue struct {
	ID     int64 `xorm:"pk"`
	RepoID int64 `xorm:"index"`

	Excluded bool `xorm:"index"`
	Stale    bool `xorm:"index"`
	Closed   bool `xorm:"index"`

	// IndexedAt represents the time the issue was indexed last time
	IndexedAt *time.Time `xorm:"updated index"`
	// UpdatedAt represents the time when the issue was updated last
	UpdatedAt *time.Time
	// MarkedAt represents the time when the issue was marked as stale
	MarkedAt *time.Time
}

Issue is a pull request or an issue from the Gitea instance

type Repository

type Repository struct {
	ID     int64  `xorm:"pk"`
	UserID int64  `xorm:"index"`
	Owner  string `xorm:"unique(owner_name)"`
	Name   string `xorm:"unique(owner_name)"`

	Activated bool
}

Repository represents a Gitea repository indexed at the local database

func FindRepositoriesByUserID

func FindRepositoriesByUserID(userID int64) ([]*Repository, error)

FindRepositoriesByUserID returns all repos of an user

type User

type User struct {
	ID       int64
	Username string
	Token    *oauth2.Token
}

User represents a signed in oauth2 gitea user saved in a session

func (*User) GiteaClient

func (user *User) GiteaClient() *gitea.Client

GiteaClient will return a gitea client with authentication of the user

Jump to

Keyboard shortcuts

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