Documentation
¶
Index ¶
- Constants
- Variables
- func AddChecksum(id string) (string, error)
- func CreateMeta(name, desc string, isAvailable bool, paramDef map[string]string) *pb.CreateMetaResponse
- func GetMeta(id uint32) *pb.GetMetaResponse
- func GetMethodExt(x protoreflect.Message, serviceName, methodName string, ...) (*[]string, error)
- func MaxEmv(p1 float32, d1 []int32, d2 []int32) int32
- func NewId() (string, error)
- func NewReport() *pb.Report
- func ReportMaxEmvResults() *pb.Report
- type AnalyzeDBGetter
- type AnalyzeRepository
- type AnalyzeServer
- func (s *AnalyzeServer) CreateMeta(ctx context.Context, in *pb.CreateMetaRequest) (*pb.CreateMetaResponse, error)
- func (s *AnalyzeServer) DeleteMeta(ctx context.Context, in *pb.DeleteMetaRequest) (*pb.DeleteMetaResponse, error)
- func (s *AnalyzeServer) GetMeta(ctx context.Context, in *pb.GetMetaRequest) (res *pb.GetMetaResponse, err error)
- func (s *AnalyzeServer) GetMetaList(ctx context.Context, in *pb.GetMetaListRequest) (*pb.GetMetaListResponse, error)
- func (s *AnalyzeServer) GetMetrics(ctx context.Context, in *pb.GetMetricsRequest) (*pb.GetMetricsResponse, error)
- func (s *AnalyzeServer) MaxEmv(ctx context.Context, in *pb.MaxEmvRequest) (*pb.MaxEmvResponse, error)
- func (s *AnalyzeServer) PutMeta(ctx context.Context, in *pb.PutMetaRequest) (*pb.PutMetaResponse, error)
- type Config
- type DefaultAnalyzeRepository
- func (s *DefaultAnalyzeRepository) Create(ctx context.Context, metaBody *pb.MetaBody) (*pb.Meta, error)
- func (s *DefaultAnalyzeRepository) Delete(ctx context.Context, id uint32) (*pb.Meta, error)
- func (s *DefaultAnalyzeRepository) Fetch(ctx context.Context, id uint32) (*pb.Meta, error)
- func (s *DefaultAnalyzeRepository) FetchFrom(ctx context.Context, id uint32) ([]uint32, error)
- func (s *DefaultAnalyzeRepository) Init() (err error)
- func (s *DefaultAnalyzeRepository) Put(ctx context.Context, id uint32, metaBody *pb.MetaBody) (*pb.Meta, error)
- type IssueRepository
- func (s *IssueRepository) AddCache(id string, vp interface{})
- func (s *IssueRepository) CreateData(ctx context.Context, data *pb.Data) (*pb.Data, error)
- func (s *IssueRepository) CreateIssue(ctx context.Context, issue *pb.Issue) (*pb.Issue, error)
- func (s *IssueRepository) CreateUser(ctx context.Context, user *pb.User) (*pb.User, error)
- func (s *IssueRepository) DeleteCache(id string, v interface{})
- func (s *IssueRepository) DeleteData(ctx context.Context, dataId string) error
- func (s *IssueRepository) DeleteIssue(ctx context.Context, issueId string) error
- func (s *IssueRepository) DeleteIssueInternal(ctx context.Context, issueId, childId, childType string) error
- func (s *IssueRepository) FetchData(ctx context.Context, dataId string) (*pb.Data, error)
- func (s *IssueRepository) FetchDataList(ctx context.Context, userId string) (data []*pb.Data, err error)
- func (s *IssueRepository) FetchIssue(ctx context.Context, issueId string) (*pb.Issue, error)
- func (s *IssueRepository) FetchIssues(ctx context.Context, userId string) ([]*pb.Issue, error)
- func (s *IssueRepository) FetchUser(ctx context.Context, userId string) (*pb.User, error)
- func (s *IssueRepository) GetCache(id string, v interface{}) (interface{}, bool)
- func (s *IssueRepository) HardDeleteData(ctx context.Context, dataId string) error
- func (s *IssueRepository) HardDeleteIssue(ctx context.Context, issueId string) error
- func (s *IssueRepository) HardDeleteUser(ctx context.Context, userId string) error
- func (s *IssueRepository) Init() (err error)
- func (s *IssueRepository) PutData(ctx context.Context, dataId string, data *pb.Data) (*pb.Data, error)
- func (s *IssueRepository) PutIssue(ctx context.Context, issueId string, issue *pb.Issue) (*pb.Issue, error)
- func (s *IssueRepository) UnDeleteData(ctx context.Context, dataId string) error
- func (s *IssueRepository) UnDeleteIssue(ctx context.Context, issueId string) error
- func (s *IssueRepository) UnDeleteIssueInternal(ctx context.Context, issueId, childId, childType string) error
- type IssueServiceServer
- func (s *IssueServiceServer) AddAnalyzedResult(ctx context.Context, in *pb.AddAnalyzedResultRequest) (*pb.AddAnalyzedResultResponse, error)
- func (s *IssueServiceServer) CreateData(ctx context.Context, in *pb.CreateDataRequest) (*pb.CreateDataResponse, error)
- func (s *IssueServiceServer) CreateIssue(ctx context.Context, in *pb.CreateIssueRequest) (res *pb.CreateIssueResponse, err error)
- func (s *IssueServiceServer) DecideBranch(ctx context.Context, in *pb.DecideBranchRequest) (*pb.DecideBranchResponse, error)
- func (s *IssueServiceServer) DeleteData(ctx context.Context, in *pb.DeleteDataRequest) (*pb.DeleteDataResponse, error)
- func (s *IssueServiceServer) DeleteIssue(ctx context.Context, in *pb.DeleteIssueRequest) (res *pb.DeleteIssueResponse, err error)
- func (s *IssueServiceServer) DeleteIssueInternal(ctx context.Context, in *pb.DeleteIssueInternalRequest) (res *pb.DeleteIssueInternalResponse, err error)
- func (s *IssueServiceServer) ExportIssue(ctx context.Context, in *pb.ExportIssueRequest) (res *pb.ExportIssueResponse, err error)
- func (s *IssueServiceServer) GetData(ctx context.Context, in *pb.GetDataRequest) (*pb.GetDataResponse, error)
- func (s *IssueServiceServer) GetIssue(ctx context.Context, in *pb.GetIssueRequest) (res *pb.GetIssueResponse, err error)
- func (s *IssueServiceServer) ListData(ctx context.Context, in *pb.ListDataRequest) (*pb.ListDataResponse, error)
- func (s *IssueServiceServer) ListIssues(ctx context.Context, in *pb.ListIssuesRequest) (res *pb.ListIssuesResponse, err error)
- func (s *IssueServiceServer) UnDeleteData(ctx context.Context, in *pb.UnDeleteDataRequest) (*pb.UnDeleteDataResponse, error)
- func (s *IssueServiceServer) UnDeleteIssue(ctx context.Context, in *pb.UnDeleteIssueRequest) (res *pb.UnDeleteIssueResponse, err error)
- func (s *IssueServiceServer) UnDeleteIssueInternal(ctx context.Context, in *pb.UnDeleteIssueInternalRequest) (res *pb.UnDeleteIssueInternalResponse, err error)
- func (s *IssueServiceServer) UpdateData(ctx context.Context, in *pb.UpdateDataRequest) (*pb.UpdateDataResponse, error)
- func (s *IssueServiceServer) UpdateIssue(ctx context.Context, in *pb.UpdateIssueRequest) (res *pb.UpdateIssueResponse, err error)
- type MaxEmvInput
- type Meta
- type MysqlAnalyzeRepository
- type MysqlConnInfo
- type MysqlDBGetter
- type PyPayload
- type ReportModel
- type ReportRepository
- type Server
- type ServerWithRepo
- type Sqlite3ConnInfo
- type Sqlite3ReportRepository
- type SqliteAnalyzeConnInfo
- type SqliteAnalyzeRepository
- type SqlteDBGetter
- type UserServiceServer
Constants ¶
const DATATABLE = "data"
const INTABLE = "internals"
const ISSUEDB = "issuedb"
const ISSUETABLE = "issues"
const USERDB = "userdb"
const USERTABLE = "users"
Variables ¶
var DialInfo = "localhost:50051"
var ErrNilInput = errors.New("nil in input")
helper converters
Functions ¶
func AddChecksum ¶
func CreateMeta ¶
func GetMeta ¶
func GetMeta(id uint32) *pb.GetMetaResponse
func GetMethodExt ¶
func GetMethodExt(x protoreflect.Message, serviceName, methodName string, xt protoreflect.ExtensionType) (*[]string, error)
helper for get extension sample to get IssueService.GetIssue's method_signature is below
ref := (&pb.Issue{}).ProtoReflect() ms, err := GetMethodExt(ref, "IssueService", "GetIssue", pb.E_MethodSignature) "issue_id" == ms[0] // should be true
func ReportMaxEmvResults ¶
Types ¶
type AnalyzeDBGetter ¶
to inject db conn to repository
type AnalyzeRepository ¶
type AnalyzeRepository interface { Init() error Fetch(ctx context.Context, id uint32) (*pb.Meta, error) Create(ctx context.Context, metaBody *pb.MetaBody) (*pb.Meta, error) Put(ctx context.Context, id uint32, metaBody *pb.MetaBody) (*pb.Meta, error) Delete(ctx context.Context, id uint32) (*pb.Meta, error) FetchFrom(ctx context.Context, id uint32) ([]uint32, error) }
TODO: consider to refactor Repository, simplifly management DB inject or remove Repository interface(this interface can used when change to not rdb) repository
type AnalyzeServer ¶
type AnalyzeServer struct { pb.AnalyzeServiceServer Repo AnalyzeRepository }
server impl
func DefaultAnalyzeServerWithRepo ¶
func DefaultAnalyzeServerWithRepo(ctx context.Context, repo AnalyzeRepository) *AnalyzeServer
constructors for server
func DefaultAnalyzeServiceServer ¶
func DefaultAnalyzeServiceServer() *AnalyzeServer
func (*AnalyzeServer) CreateMeta ¶
func (s *AnalyzeServer) CreateMeta(ctx context.Context, in *pb.CreateMetaRequest) (*pb.CreateMetaResponse, error)
func (*AnalyzeServer) DeleteMeta ¶
func (s *AnalyzeServer) DeleteMeta(ctx context.Context, in *pb.DeleteMetaRequest) (*pb.DeleteMetaResponse, error)
func (*AnalyzeServer) GetMeta ¶
func (s *AnalyzeServer) GetMeta(ctx context.Context, in *pb.GetMetaRequest) (res *pb.GetMetaResponse, err error)
impl for GRPC interface
func (*AnalyzeServer) GetMetaList ¶
func (s *AnalyzeServer) GetMetaList(ctx context.Context, in *pb.GetMetaListRequest) (*pb.GetMetaListResponse, error)
func (*AnalyzeServer) GetMetrics ¶
func (s *AnalyzeServer) GetMetrics(ctx context.Context, in *pb.GetMetricsRequest) (*pb.GetMetricsResponse, error)
TODO
func (*AnalyzeServer) MaxEmv ¶
func (s *AnalyzeServer) MaxEmv(ctx context.Context, in *pb.MaxEmvRequest) (*pb.MaxEmvResponse, error)
func (*AnalyzeServer) PutMeta ¶
func (s *AnalyzeServer) PutMeta(ctx context.Context, in *pb.PutMetaRequest) (*pb.PutMetaResponse, error)
type Config ¶
type Config struct { Host string `yaml:"host"` Port int `yaml:"port"` MysqlHost string `yaml:"mysql_host"` MysqlPort uint `yaml:"mysql_port"` MysqlUser string `yaml:"mysql_user"` MysqlPassword string `yaml:"mysql_password"` MysqlDbName string `yaml:"mysql_dbname"` }
func InitConfig ¶
type DefaultAnalyzeRepository ¶
type DefaultAnalyzeRepository struct { DBGetter AnalyzeDBGetter Cache *lru.Cache }
to default func definition injectable conn
func (*DefaultAnalyzeRepository) Init ¶
func (s *DefaultAnalyzeRepository) Init() (err error)
type IssueRepository ¶
func DefaultIssueRepository ¶
func DefaultIssueRepository() *IssueRepository
func (*IssueRepository) AddCache ¶
func (s *IssueRepository) AddCache(id string, vp interface{})
Add item to repository cache with id(internal recognize its type), value as pointer. When query passed as id, it maybe work even no support query base cache.
func (*IssueRepository) CreateData ¶
data for repository
func (*IssueRepository) CreateIssue ¶
Issue
func (*IssueRepository) CreateUser ¶
func (*IssueRepository) DeleteCache ¶
func (s *IssueRepository) DeleteCache(id string, v interface{})
func (*IssueRepository) DeleteData ¶
func (s *IssueRepository) DeleteData(ctx context.Context, dataId string) error
func (*IssueRepository) DeleteIssue ¶
func (s *IssueRepository) DeleteIssue(ctx context.Context, issueId string) error
func (*IssueRepository) DeleteIssueInternal ¶
func (s *IssueRepository) DeleteIssueInternal(ctx context.Context, issueId, childId, childType string) error
func (*IssueRepository) FetchDataList ¶
func (*IssueRepository) FetchIssue ¶
func (*IssueRepository) FetchIssues ¶
func (*IssueRepository) GetCache ¶
func (s *IssueRepository) GetCache(id string, v interface{}) (interface{}, bool)
Get item from repository cache with id(internal, recognize its type), value as pointer
func (*IssueRepository) HardDeleteData ¶
func (s *IssueRepository) HardDeleteData(ctx context.Context, dataId string) error
func (*IssueRepository) HardDeleteIssue ¶
func (s *IssueRepository) HardDeleteIssue(ctx context.Context, issueId string) error
func (*IssueRepository) HardDeleteUser ¶
func (s *IssueRepository) HardDeleteUser(ctx context.Context, userId string) error
func (*IssueRepository) Init ¶
func (s *IssueRepository) Init() (err error)
func (*IssueRepository) UnDeleteData ¶
func (s *IssueRepository) UnDeleteData(ctx context.Context, dataId string) error
func (*IssueRepository) UnDeleteIssue ¶
func (s *IssueRepository) UnDeleteIssue(ctx context.Context, issueId string) error
func (*IssueRepository) UnDeleteIssueInternal ¶
func (s *IssueRepository) UnDeleteIssueInternal(ctx context.Context, issueId, childId, childType string) error
type IssueServiceServer ¶
type IssueServiceServer struct { // embed service server interface, to check whether all interface impl, comment out and embed pb.UnsafeIssueServiceServer interface pb.IssueServiceServer Repo *IssueRepository }
func DefaultIssueServiceServerWithRepo ¶
func DefaultIssueServiceServerWithRepo(ctx context.Context, repo *IssueRepository) *IssueServiceServer
func (*IssueServiceServer) AddAnalyzedResult ¶
func (s *IssueServiceServer) AddAnalyzedResult(ctx context.Context, in *pb.AddAnalyzedResultRequest) (*pb.AddAnalyzedResultResponse, error)
func (*IssueServiceServer) CreateData ¶
func (s *IssueServiceServer) CreateData(ctx context.Context, in *pb.CreateDataRequest) (*pb.CreateDataResponse, error)
data
func (*IssueServiceServer) CreateIssue ¶
func (s *IssueServiceServer) CreateIssue(ctx context.Context, in *pb.CreateIssueRequest) (res *pb.CreateIssueResponse, err error)
service
func (*IssueServiceServer) DecideBranch ¶
func (s *IssueServiceServer) DecideBranch(ctx context.Context, in *pb.DecideBranchRequest) (*pb.DecideBranchResponse, error)
func (*IssueServiceServer) DeleteData ¶
func (s *IssueServiceServer) DeleteData(ctx context.Context, in *pb.DeleteDataRequest) (*pb.DeleteDataResponse, error)
func (*IssueServiceServer) DeleteIssue ¶
func (s *IssueServiceServer) DeleteIssue(ctx context.Context, in *pb.DeleteIssueRequest) (res *pb.DeleteIssueResponse, err error)
func (*IssueServiceServer) DeleteIssueInternal ¶
func (s *IssueServiceServer) DeleteIssueInternal(ctx context.Context, in *pb.DeleteIssueInternalRequest) (res *pb.DeleteIssueInternalResponse, err error)
func (*IssueServiceServer) ExportIssue ¶
func (s *IssueServiceServer) ExportIssue(ctx context.Context, in *pb.ExportIssueRequest) (res *pb.ExportIssueResponse, err error)
func (*IssueServiceServer) GetData ¶
func (s *IssueServiceServer) GetData(ctx context.Context, in *pb.GetDataRequest) (*pb.GetDataResponse, error)
func (*IssueServiceServer) GetIssue ¶
func (s *IssueServiceServer) GetIssue(ctx context.Context, in *pb.GetIssueRequest) (res *pb.GetIssueResponse, err error)
func (*IssueServiceServer) ListData ¶
func (s *IssueServiceServer) ListData(ctx context.Context, in *pb.ListDataRequest) (*pb.ListDataResponse, error)
func (*IssueServiceServer) ListIssues ¶
func (s *IssueServiceServer) ListIssues(ctx context.Context, in *pb.ListIssuesRequest) (res *pb.ListIssuesResponse, err error)
func (*IssueServiceServer) UnDeleteData ¶
func (s *IssueServiceServer) UnDeleteData(ctx context.Context, in *pb.UnDeleteDataRequest) (*pb.UnDeleteDataResponse, error)
func (*IssueServiceServer) UnDeleteIssue ¶
func (s *IssueServiceServer) UnDeleteIssue(ctx context.Context, in *pb.UnDeleteIssueRequest) (res *pb.UnDeleteIssueResponse, err error)
func (*IssueServiceServer) UnDeleteIssueInternal ¶
func (s *IssueServiceServer) UnDeleteIssueInternal(ctx context.Context, in *pb.UnDeleteIssueInternalRequest) (res *pb.UnDeleteIssueInternalResponse, err error)
func (*IssueServiceServer) UpdateData ¶
func (s *IssueServiceServer) UpdateData(ctx context.Context, in *pb.UpdateDataRequest) (*pb.UpdateDataResponse, error)
func (*IssueServiceServer) UpdateIssue ¶
func (s *IssueServiceServer) UpdateIssue(ctx context.Context, in *pb.UpdateIssueRequest) (res *pb.UpdateIssueResponse, err error)
type MaxEmvInput ¶
type Meta ¶
type Meta struct { gorm.Model Name string Desc string IsAvailable bool `gorm:"column:is_available"` ParamDef string `gorm:"column:param_def"` }
internal domain(model) compatible with rdb
type MysqlAnalyzeRepository ¶
type MysqlAnalyzeRepository struct {
*DefaultAnalyzeRepository
}
Mysql Repostitory
func NewMysqlAnalyzeRepository ¶
func NewMysqlAnalyzeRepository(info *MysqlConnInfo) *MysqlAnalyzeRepository
constructor for mysql
type MysqlConnInfo ¶
mysql conn info for Repository
func DefaultMysqlAnalyzeConnInfo ¶
func DefaultMysqlAnalyzeConnInfo() *MysqlConnInfo
type MysqlDBGetter ¶
type MysqlDBGetter struct {
Info *MysqlConnInfo
}
type ReportModel ¶
domain model
type ReportRepository ¶
var Repo ReportRepository
type Server ¶
type Server struct {
pb.GDeanServiceServer
}
server impl
func DefaultServer ¶
func DefaultServer() *Server
func (*Server) ReportMaxEmvResults ¶
func (s *Server) ReportMaxEmvResults(ctx context.Context, in *pb.ReportRequest) (*pb.ReportResponse, error)
type ServerWithRepo ¶
type ServerWithRepo struct { Server *Server Repo ReportRepository }
func DefaultServerWithRepo ¶
func DefaultServerWithRepo(ctx context.Context, server *Server, report ReportRepository) *ServerWithRepo
type Sqlite3ConnInfo ¶
type Sqlite3ConnInfo string
func DefaultSqlite3ConnInfo ¶
func DefaultSqlite3ConnInfo() *Sqlite3ConnInfo
type Sqlite3ReportRepository ¶
type Sqlite3ReportRepository struct {
// contains filtered or unexported fields
}
func NewSqlite3ReportRepository ¶
func NewSqlite3ReportRepository(filename *Sqlite3ConnInfo) *Sqlite3ReportRepository
func (Sqlite3ReportRepository) Fetch ¶
func (r Sqlite3ReportRepository) Fetch() *pb.Report
func (Sqlite3ReportRepository) Put ¶
func (r Sqlite3ReportRepository) Put(res *pb.Result)
type SqliteAnalyzeConnInfo ¶
type SqliteAnalyzeConnInfo string
func DefaultSqliteAnalyzeConnInfo ¶
func DefaultSqliteAnalyzeConnInfo() *SqliteAnalyzeConnInfo
type SqliteAnalyzeRepository ¶
type SqliteAnalyzeRepository struct {
*DefaultAnalyzeRepository
}
Repository implementation for rdb Sqlite Repoitory embedded Default(expext to injecte sqlite conn)
func NewSqliteAnalyzeRepository ¶
func NewSqliteAnalyzeRepository(info *SqliteAnalyzeConnInfo) *SqliteAnalyzeRepository
constructor for sqlite
type SqlteDBGetter ¶
type SqlteDBGetter struct {
Info SqliteAnalyzeConnInfo
}
has conn info struct work with sqlite repository
type UserServiceServer ¶
type UserServiceServer struct { pb.UserServiceServer // TODO: Separate from issue repository Repo *IssueRepository }
func DefaultUserServiceServerWithRepo ¶
func DefaultUserServiceServerWithRepo(ctx context.Context, repo *IssueRepository) *UserServiceServer
func (*UserServiceServer) CreateUser ¶
func (s *UserServiceServer) CreateUser(ctx context.Context, in *pb.CreateUserRequest) (*pb.CreateUserResponse, error)