Documentation ¶
Index ¶
- Constants
- type Config
- type MemoryConfig
- type MemoryRepo
- func (mr *MemoryRepo) CreateProject(_ context.Context, req *projectpb.CreateProjectRequest) (*projectpb.Project, error)
- func (mr *MemoryRepo) DeleteProject(_ context.Context, req *projectpb.DeleteProjectRequest) (*emptypb.Empty, error)
- func (mr *MemoryRepo) GetProject(_ context.Context, req *projectpb.GetProjectRequest) (*projectpb.Project, error)
- func (mr *MemoryRepo) ListProjects(_ context.Context, req *projectpb.ListProjectsRequest) (*projectpb.ListProjectsResponse, error)
- type Repository
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 ¶
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 (mr *MemoryRepo) CreateProject(_ context.Context, req *projectpb.CreateProjectRequest) (*projectpb.Project, error)
func (*MemoryRepo) DeleteProject ¶
func (mr *MemoryRepo) DeleteProject(_ context.Context, req *projectpb.DeleteProjectRequest) (*emptypb.Empty, error)
func (*MemoryRepo) GetProject ¶
func (mr *MemoryRepo) GetProject(_ context.Context, req *projectpb.GetProjectRequest) (*projectpb.Project, error)
func (*MemoryRepo) ListProjects ¶
func (mr *MemoryRepo) ListProjects(_ context.Context, req *projectpb.ListProjectsRequest) (*projectpb.ListProjectsResponse, error)
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)
Click to show internal directories.
Click to hide internal directories.