repository

package
v0.0.0-...-16952c6 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package repository contains package methods for git repository support.

Index

Constants

View Source
const SchemaVersion = 0

Variables

This section is empty.

Functions

func Delete

func Delete(
	ctx context.Context,
	conn *pgx.Conn,
	id models.ID,
) error

Delete actually deletes a row - unlike other models that merely leave a row as not active. Since a repositories row represents a real git repository that can be deleted, the row should be deleted also.

Types

type Repository

type Repository struct {
	models.Base
	Name  safe.VarChar `json:"name"`
	Org   models.ID    `json:"org"`
	Owner models.ID    `json:"owner"`
	Path  string       `json:"path"`
}

Repository models a row of the orgs table.

func Create

func Create(
	ctx context.Context,
	conn *pgx.Conn,
	name safe.VarChar,
	org models.ID,
	owner models.ID,
	path string,
	role models.Role,
) (*Repository, error)

func Read

func Read(
	ctx context.Context,
	conn *pgx.Conn,
	id models.ID,
) (*Repository, error)

func (*Repository) GetID

func (r *Repository) GetID() models.ID

GetID implements models.WithID.

func (*Repository) GetOrg

func (r *Repository) GetOrg() models.ID

GetRepository implements models.WithOrg.

func (*Repository) GetRepository

func (r *Repository) GetRepository() models.ID

GetRepository implements models.WithRepository.

func (*Repository) GetUser

func (r *Repository) GetUser() models.ID

GetRepository implements models.WithUser.

func (*Repository) Insert

func (r *Repository) Insert(ctx context.Context, conn *pgx.Conn) error

Jump to

Keyboard shortcuts

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