repository

package
v0.0.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BackendMemory = "memory"
	BackendMysql  = "mysql"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Backend string `yaml:"backend"`

	Memory MemoryConfig `yaml:"memory"`
}

Config RepoCfg Connections config Here are each of the database connections for application.

func (*Config) RegisterFlags

func (cfg *Config) RegisterFlags(fs *flag.FlagSet)

func (*Config) Validate

func (cfg *Config) Validate() error

Validate RepoCfg config.

type MemoryConfig

type MemoryConfig struct {
	Enabled bool `yaml:"enabled"`
}

func (*MemoryConfig) RegisterFlags

func (cfg *MemoryConfig) RegisterFlags(fs *flag.FlagSet)

func (*MemoryConfig) RegisterFlagsWithPrefix

func (cfg *MemoryConfig) RegisterFlagsWithPrefix(prefix string, fs *flag.FlagSet)

func (*MemoryConfig) Validate

func (cfg *MemoryConfig) Validate() error

type MemoryRepo

type MemoryRepo struct {
	// contains filtered or unexported fields
}

MemoryRepo fulfills the Repository interface All objects are managed in an in-memory non-persistent store.

MemoryRepo is used to implement ProjectServiceServer.

func NewMemoryRepo

func NewMemoryRepo() (*MemoryRepo, error)

NewMemoryRepo is a factory function to generate a new repository

func (*MemoryRepo) CreateProject

func (*MemoryRepo) DeleteProject

func (mr *MemoryRepo) DeleteProject(_ context.Context, req *projectpb.DeleteProjectRequest) (*emptypb.Empty, error)

func (*MemoryRepo) GetProject

func (*MemoryRepo) ListProjects

ListProjects returns up to pageSize number of projects beginning at pageToken, or from start if pageToken is the empty string.

type Repository

type Repository interface {
	projectpb.ProjectServiceServer
}

func NewRepository

func NewRepository(cfg Config) (Repository, error)

Jump to

Keyboard shortcuts

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