Versions in this module Expand all Collapse all v0 v0.4.0 Apr 20, 2020 Changes in this version + const Delete + const Insert + const Update + func ComposePagination(base sq.SelectBuilder, paginationParam PaginationParam) sq.SelectBuilder + func GetUsername(ctx context.Context) string + func TagStructLevelValidation(sl validator.StructLevel) + type Attrs map[string]string + func (a *Attrs) Scan(value interface{}) error + func (a Attrs) Value() (driver.Value, error) + type AuditTrail struct + EntityID int64 + EntityName string + ID int64 + NewData JSON + OldData JSON + Operation string + Time time.Time + Username string + type AuditTrailRepo interface + Find func(ctx context.Context, paginationParam PaginationParam) ([]*AuditTrail, error) + Insert func(ctx context.Context, auditTrail AuditTrail) (lastInsertID int64, err error) + func NewAuditTrailRepo(impl AuditTrailRepoImpl) AuditTrailRepo + type AuditTrailRepoImpl struct + func (r *AuditTrailRepoImpl) Find(ctx context.Context, paginationParam PaginationParam) (list []*AuditTrail, err error) + func (r *AuditTrailRepoImpl) Insert(ctx context.Context, m AuditTrail) (lastInsertID int64, err error) + type CtxKey int + const TokenCtxKey + type DataSource struct + CreatedAt time.Time + ID int64 + Name string + URL string + UpdatedAt time.Time + type DataSourceRepo interface + Delete func(context.Context, int64) error + Find func(context.Context) ([]*DataSource, error) + FindOne func(context.Context, int64) (*DataSource, error) + Insert func(context.Context, DataSource) (lastInsertID int64, err error) + Update func(context.Context, DataSource) error + func NewDataSourceRepo(impl DataSourceRepoImpl) DataSourceRepo + type DataSourceRepoImpl struct + func (r *DataSourceRepoImpl) Delete(ctx context.Context, id int64) (err error) + func (r *DataSourceRepoImpl) Find(ctx context.Context) (list []*DataSource, err error) + func (r *DataSourceRepoImpl) FindOne(ctx context.Context, id int64) (e *DataSource, err error) + func (r *DataSourceRepoImpl) Insert(ctx context.Context, e DataSource) (lastInsertID int64, err error) + func (r *DataSourceRepoImpl) Update(ctx context.Context, e DataSource) (err error) + type Filter struct + Col string + Cond string + type GoogleOauth2UserInfoResp map[string]interface + type History struct + Data JSON + EntityFrom string + EntityID int64 + ID int64 + Time time.Time + Username string + type HistoryOperationType string + type HistoryRepo interface + Insert func(ctx context.Context, history History) (lastInsertID int64, err error) + func NewHistoryRepo(impl HistoryRepoImpl) HistoryRepo + type HistoryRepoImpl struct + func (r *HistoryRepoImpl) Insert(ctx context.Context, m History) (lastInsertID int64, err error) + type JSON json.RawMessage + func (j *JSON) MarshalJSON() ([]byte, error) + func (j *JSON) Scan(src interface{}) error + func (j *JSON) UnmarshalJSON(data []byte) error + func (j JSON) Value() (driver.Value, error) + type Next struct + Col string + Order string + Value string + type OperationType string + const InsertHistory + type PaginationParam struct + Filters map[string]*Filter + Limit uint64 + NextKey *Next + Nexts []Next + Offset uint64 + Sorts []Sort + func BuildPaginationParam(queryParams url.Values, validColumns []string) PaginationParam + type PaginationType int + const KeysetPagination + const NoPagination + const OffsetPagination + func GetPaginationType(paginationParam PaginationParam) PaginationType + type Rule struct + ChangeStatusAt time.Time + CreatedAt time.Time + DataSourceID *int64 + ID int64 + Name string + Status string + URLPattern string + UpdatedAt time.Time + func (rule Rule) Validate() error + type RuleRepo interface + Delete func(ctx context.Context, id int64) error + Find func(ctx context.Context, paginationParam PaginationParam) ([]*Rule, error) + FindOne func(ctx context.Context, id int64) (*Rule, error) + Insert func(ctx context.Context, rule Rule) (lastInsertID int64, err error) + Update func(ctx context.Context, rule Rule) error + func NewRuleRepo(impl RuleRepoImpl) RuleRepo + type RuleRepoImpl struct + func (r *RuleRepoImpl) Delete(ctx context.Context, id int64) (err error) + func (r *RuleRepoImpl) Find(ctx context.Context, paginationParam PaginationParam) (list []*Rule, err error) + func (r *RuleRepoImpl) FindOne(ctx context.Context, id int64) (*Rule, error) + func (r *RuleRepoImpl) Insert(ctx context.Context, rule Rule) (lastInsertID int64, err error) + func (r *RuleRepoImpl) Update(ctx context.Context, rule Rule) (err error) + type Sort struct + Col string + Order string + type Tag struct + Attributes Attrs + CreatedAt time.Time + ID int64 + Locale string + RuleID int64 + Type string + UpdatedAt time.Time + Value string + func (tag Tag) Validate() error + type TagRepo interface + Delete func(context.Context, int64) error + Find func(context.Context, ...dbkit.FindOption) ([]*Tag, error) + FindByRuleAndLocale func(ctx context.Context, ruleID int64, locale string) ([]*Tag, error) + FindOne func(context.Context, int64) (*Tag, error) + Insert func(context.Context, Tag) (lastInsertID int64, err error) + Update func(context.Context, Tag) error + func NewTagRepo(impl TagRepoImpl) TagRepo + type TagRepoImpl struct + func (r *TagRepoImpl) Delete(ctx context.Context, id int64) (err error) + func (r *TagRepoImpl) Find(ctx context.Context, opts ...dbkit.FindOption) (list []*Tag, err error) + func (r *TagRepoImpl) FindByRuleAndLocale(ctx context.Context, ruleID int64, locale string) (list []*Tag, err error) + func (r *TagRepoImpl) FindOne(ctx context.Context, id int64) (e *Tag, err error) + func (r *TagRepoImpl) Insert(ctx context.Context, e Tag) (lastInsertID int64, err error) + func (r *TagRepoImpl) Update(ctx context.Context, e Tag) (err error) + type TokenReq struct + Holder string + SetCookie bool + type TokenResp struct + Token string + type URLSync struct + CreatedAt time.Time + LatestURLPattern *string + Operation string + RuleID int64 + Version int64 + type URLSyncRepo interface + Find func(ctx context.Context) ([]*URLSync, error) + FindOne func(ctx context.Context, id int64) (*URLSync, error) + GetLatestVersion func(ctx context.Context) (latestVersion int64, err error) + GetListDiff func(ctx context.Context, offsetVersion int64) ([]*URLSync, error) + Insert func(ctx context.Context, URLSync URLSync) (lastInsertID int64, err error) + func NewURLSyncRepo(impl URLSyncRepoImpl) URLSyncRepo + type URLSyncRepoImpl struct + func (r *URLSyncRepoImpl) Find(ctx context.Context) (list []*URLSync, err error) + func (r *URLSyncRepoImpl) FindOne(ctx context.Context, version int64) (urlStoreSync *URLSync, err error) + func (r *URLSyncRepoImpl) GetLatestVersion(ctx context.Context) (latestVersion int64, err error) + func (r *URLSyncRepoImpl) GetListDiff(ctx context.Context, offsetVersion int64) (list []*URLSync, err error) + func (r *URLSyncRepoImpl) Insert(ctx context.Context, urlStoreSync URLSync) (lastInsertID int64, err error)