api

package module
v0.0.0-...-27a683d Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type API

type API interface {
	Run(ctx context.Context) error
}

func New

func New(
	golinkSvc golinkv1connect.GolinkServiceHandler,
	port, pathPrefix string,
	allowedOrigins []string,
	interceptors []connect.Interceptor,
	debug bool,
) API

type Repository

type Repository interface {
	Transaction(ctx context.Context, f func(ctx context.Context, tx *firestore.Transaction) error) error
	TxExists(ctx context.Context, tx *firestore.Transaction, name string) (bool, error)
	Get(ctx context.Context, name string) (*dto, error)
	TxGet(ctx context.Context, tx *firestore.Transaction, name string) (*dto, error)
	TxCreate(ctx context.Context, tx *firestore.Transaction, dto *dto) error
	ListByOwner(ctx context.Context, owner string) ([]*dto, error)
	ListByURL(ctx context.Context, url string) ([]*dto, error)
	TxUpdate(ctx context.Context, tx *firestore.Transaction, dto *dto) error
	TxDelete(ctx context.Context, tx *firestore.Transaction, name string) error
	TxAddOwner(ctx context.Context, tx *firestore.Transaction, name string, owner string) error
	TxRemoveOwner(ctx context.Context, tx *firestore.Transaction, name string, owner string) error
}

func NewRepository

func NewRepository(c *firestore.Client) Repository

Directories

Path Synopsis
cmd
api
gen

Jump to

Keyboard shortcuts

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