model

package
v0.0.0-...-d42cbe4 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACL

type ACL struct {
	ID      int       `json:"id"`
	Created time.Time `json:"created"`

	RawAccessMode string
	RepoID        int
	UserID        int
	// contains filtered or unexported fields
}

TODO: Drop updated column from database

func (*ACL) Alias

func (acl *ACL) Alias() string

func (*ACL) As

func (acl *ACL) As(alias string) *ACL

func (*ACL) Fields

func (acl *ACL) Fields() *database.ModelFields

func (*ACL) Mode

func (acl *ACL) Mode() AccessMode

func (*ACL) QueryWithCursor

func (acl *ACL) QueryWithCursor(ctx context.Context,
	runner sq.BaseRunner, q sq.SelectBuilder,
	cur *model.Cursor) ([]*ACL, *model.Cursor)

func (*ACL) Table

func (acl *ACL) Table() string

type Artifact

type Artifact struct {
	ID       int       `json:"id"`
	Created  time.Time `json:"created"`
	Filename string    `json:"filename"`
	Checksum string    `json:"checksum"`
	Size     int       `json:"size"`

	Commit string
	// contains filtered or unexported fields
}

func (*Artifact) Alias

func (a *Artifact) Alias() string

func (*Artifact) As

func (a *Artifact) As(alias string) *Artifact

func (*Artifact) Fields

func (a *Artifact) Fields() *database.ModelFields

func (*Artifact) QueryWithCursor

func (a *Artifact) QueryWithCursor(ctx context.Context,
	runner sq.BaseRunner, q sq.SelectBuilder,
	cur *model.Cursor) ([]*Artifact, *model.Cursor)

func (*Artifact) Table

func (a *Artifact) Table() string

type BinaryBlob

type BinaryBlob struct {
	Type    ObjectType `json:"type"`
	ID      string     `json:"id"`
	ShortID string     `json:"shortId"`
	Raw     string     `json:"raw"`

	Base64 string `json:"base64"`
	// contains filtered or unexported fields
}

func (BinaryBlob) IsBlob

func (BinaryBlob) IsBlob()

func (BinaryBlob) IsObject

func (BinaryBlob) IsObject()

type Commit

type Commit struct {
	Type    ObjectType `json:"type"`
	ID      string     `json:"id"`
	ShortID string     `json:"shortId"`
	Raw     string     `json:"raw"`
	// contains filtered or unexported fields
}

func CommitFromObject

func CommitFromObject(repo *RepoWrapper, obj *object.Commit) *Commit

func (*Commit) Author

func (c *Commit) Author() *Signature

func (*Commit) Committer

func (c *Commit) Committer() *Signature

func (*Commit) DiffContext

func (c *Commit) DiffContext(ctx context.Context) string

func (Commit) IsObject

func (Commit) IsObject()

func (*Commit) Message

func (c *Commit) Message() string

func (*Commit) Parents

func (c *Commit) Parents() []*Commit

func (*Commit) Tree

func (c *Commit) Tree() *Tree

type Object

type Object interface {
	IsObject()
}

func BlobFromObject

func BlobFromObject(repo *RepoWrapper, obj *object.Blob) Object

func LookupObject

func LookupObject(repo *RepoWrapper, hash plumbing.Hash) (Object, error)

type Reference

type Reference struct {
	Repo *Repository
	Ref  *plumbing.Reference
}

func (*Reference) Follow

func (r *Reference) Follow() Object

func (*Reference) Name

func (r *Reference) Name() string

func (*Reference) Target

func (r *Reference) Target() string

type RepoWrapper

type RepoWrapper struct {
	*git.Repository
	sync.Mutex
}

func WrapRepo

func WrapRepo(repo *git.Repository) *RepoWrapper

type Repository

type Repository struct {
	ID          int       `json:"id"`
	Created     time.Time `json:"created"`
	Updated     time.Time `json:"updated"`
	Name        string    `json:"name"`
	Description *string   `json:"description"`
	Readme      *string   `json:"readme"`

	Path       string
	OwnerID    int
	Visibility Visibility
	// contains filtered or unexported fields
}

func (*Repository) Alias

func (r *Repository) Alias() string

func (*Repository) As

func (r *Repository) As(alias string) *Repository

func (*Repository) DefaultSearch

func (r *Repository) DefaultSearch(query sq.SelectBuilder,
	term string) (sq.SelectBuilder, error)

func (*Repository) Fields

func (r *Repository) Fields() *database.ModelFields

func (*Repository) Head

func (r *Repository) Head() *Reference

func (*Repository) QueryWithCursor

func (r *Repository) QueryWithCursor(ctx context.Context,
	runner sq.BaseRunner, q sq.SelectBuilder,
	cur *model.Cursor) ([]*Repository, *model.Cursor)

func (*Repository) Repo

func (r *Repository) Repo() *RepoWrapper

func (*Repository) Table

func (r *Repository) Table() string

type TextBlob

type TextBlob struct {
	Type    ObjectType `json:"type"`
	ID      string     `json:"id"`
	ShortID string     `json:"shortId"`
	Raw     string     `json:"raw"`

	Text string `json:"text"`
	// contains filtered or unexported fields
}

func (TextBlob) IsBlob

func (TextBlob) IsBlob()

func (TextBlob) IsObject

func (TextBlob) IsObject()

type Tree

type Tree struct {
	Type    ObjectType `json:"type"`
	ID      string     `json:"id"`
	ShortID string     `json:"shortId"`
	Raw     string     `json:"raw"`
	// contains filtered or unexported fields
}

func TreeFromObject

func TreeFromObject(repo *RepoWrapper, obj *object.Tree) *Tree

func (*Tree) Entry

func (tree *Tree) Entry(path string) *TreeEntry

func (*Tree) GetEntries

func (tree *Tree) GetEntries() []*TreeEntry

func (Tree) IsObject

func (Tree) IsObject()

type TreeEntry

type TreeEntry struct {
	Name string `json:"name"`
	Mode int    `json:"mode"`
	// contains filtered or unexported fields
}

func (*TreeEntry) ID

func (ent *TreeEntry) ID() string

func (*TreeEntry) Object

func (ent *TreeEntry) Object() Object

type User

type User struct {
	ID       int       `json:"id"`
	Created  time.Time `json:"created"`
	Updated  time.Time `json:"updated"`
	Username string    `json:"username"`
	Email    string    `json:"email"`
	URL      *string   `json:"url"`
	Location *string   `json:"location"`
	Bio      *string   `json:"bio"`
	// contains filtered or unexported fields
}

func (*User) Alias

func (u *User) Alias() string

func (*User) As

func (u *User) As(alias string) *User

func (*User) CanonicalName

func (u *User) CanonicalName() string

func (*User) Fields

func (u *User) Fields() *database.ModelFields

func (User) IsEntity

func (User) IsEntity()

func (*User) Table

func (u *User) Table() string

type UserWebhookSubscription

type UserWebhookSubscription struct {
	ID     int            `json:"id"`
	Events []WebhookEvent `json:"events"`
	Query  string         `json:"query"`
	URL    string         `json:"url"`

	UserID     int
	AuthMethod string
	ClientID   *string
	TokenHash  *string
	Expires    *time.Time
	Grants     *string
	NodeID     *string
	// contains filtered or unexported fields
}

func (*UserWebhookSubscription) Alias

func (sub *UserWebhookSubscription) Alias() string

func (*UserWebhookSubscription) As

func (*UserWebhookSubscription) Fields

func (UserWebhookSubscription) IsWebhookSubscription

func (UserWebhookSubscription) IsWebhookSubscription()

func (*UserWebhookSubscription) QueryWithCursor

func (sub *UserWebhookSubscription) QueryWithCursor(ctx context.Context,
	runner sq.BaseRunner, q sq.SelectBuilder,
	cur *model.Cursor) ([]WebhookSubscription, *model.Cursor)

func (*UserWebhookSubscription) Table

func (sub *UserWebhookSubscription) Table() string

type WebhookDelivery

type WebhookDelivery struct {
	UUID            string       `json:"uuid"`
	Date            time.Time    `json:"date"`
	Event           WebhookEvent `json:"event"`
	RequestBody     string       `json:"requestBody"`
	ResponseBody    *string      `json:"responseBody"`
	ResponseHeaders *string      `json:"responseHeaders"`
	ResponseStatus  *int         `json:"responseStatus"`

	ID             int
	SubscriptionID int
	Name           string
	// contains filtered or unexported fields
}

func (*WebhookDelivery) Alias

func (whd *WebhookDelivery) Alias() string

func (*WebhookDelivery) As

func (whd *WebhookDelivery) As(alias string) *WebhookDelivery

func (*WebhookDelivery) Fields

func (whd *WebhookDelivery) Fields() *database.ModelFields

func (*WebhookDelivery) QueryWithCursor

func (whd *WebhookDelivery) QueryWithCursor(ctx context.Context,
	runner sq.BaseRunner, q sq.SelectBuilder,
	cur *model.Cursor) ([]*WebhookDelivery, *model.Cursor)

func (*WebhookDelivery) Table

func (whd *WebhookDelivery) Table() string

func (*WebhookDelivery) WithName

func (whd *WebhookDelivery) WithName(name string) *WebhookDelivery

Jump to

Keyboard shortcuts

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