repositories

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GitProviders = []string{"github"}
)

Functions

func Exist

func Exist(ctx context.Context, kv kvdb.KVDB, id string) bool

func ExistOn

func ExistOn(ctx context.Context, kv kvdb.KVDB, provider, id string) bool

func Provider

func Provider(ctx context.Context, kv kvdb.KVDB, id string) (string, error)

Types

type Data

type Data map[string]interface{}

type GithubRepository

type GithubRepository struct {
	RepositoryCommon
	Id  int
	Key string
}

func (*GithubRepository) Delete

func (r *GithubRepository) Delete(ctx context.Context) (err error)

func (*GithubRepository) Hooks

func (r *GithubRepository) Hooks(ctx context.Context) []hooks.Hook

func (*GithubRepository) Register

func (r *GithubRepository) Register(ctx context.Context) (err error)

func (*GithubRepository) Serialize

func (r *GithubRepository) Serialize() Data

type Repository

type Repository interface {
	Register(ctx context.Context) error
	Delete(ctx context.Context) error
	Serialize() Data
	Hooks(ctx context.Context) []hooks.Hook
}

func Fetch

func Fetch(ctx context.Context, kv kvdb.KVDB, id string) (Repository, error)

TODO: ask for provider id: provided as string even if it's an int

func New

func New(kv kvdb.KVDB, data Data) (Repository, error)

TODO: Verbose errors

type RepositoryCommon

type RepositoryCommon struct {
	KV       kvdb.KVDB
	Provider string
	Project  string
}

Jump to

Keyboard shortcuts

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