Documentation ¶
Index ¶
- Constants
- Variables
- func FormatLimitOffset(limit, offset int) string
- type DB
- type NullString
- type NullTime
- type ProxyService
- func (s *ProxyService) CreateProxy(ctx context.Context, proxy *batproxy.Proxy, opts batproxy.CreateProxyOptions) error
- func (s *ProxyService) DeleteProxy(ctx context.Context, proxyID string) error
- func (s *ProxyService) ListProxies(ctx context.Context, opts batproxy.ListProxiesOptions) (page *batproxy.ListProxiesPage, err error)
- type ProxyServiceOptions
- type Tx
- type UTCTime
Constants ¶
View Source
const (
// Datetime represents mysql DATETIME.
Datetime = "2006-01-02 15:04:05"
)
Variables ¶
View Source
var ( // CST represents China Standard Time. CST = time.FixedZone("CST", 8*60*60) )
Functions ¶
func FormatLimitOffset ¶
FormatLimitOffset returns a SQL string for a given limit & offset. Clauses are only added if limit and/or offset are greater than zero.
Types ¶
type DB ¶
type DB struct { // Datasource name. DSN string Logger logr.Logger // Returns the current time. Defaults to time.Now(). // Can be mocked for tests. Now func() time.Time // contains filtered or unexported fields }
type NullString ¶
type NullString string
NullString represents a helper wrapper for string.
func (*NullString) Scan ¶
func (s *NullString) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullTime ¶
NullTime represents a helper wrapper for time.Time. It automatically converts time fields to/from RFC 3339 format. Also supports NULL for zero time.
type ProxyService ¶
type ProxyService struct {
// contains filtered or unexported fields
}
func NewProxyService ¶ added in v0.1.0
func NewProxyService(db *DB, opts ProxyServiceOptions) *ProxyService
func (*ProxyService) CreateProxy ¶
func (s *ProxyService) CreateProxy(ctx context.Context, proxy *batproxy.Proxy, opts batproxy.CreateProxyOptions) error
func (*ProxyService) DeleteProxy ¶
func (s *ProxyService) DeleteProxy(ctx context.Context, proxyID string) error
func (*ProxyService) ListProxies ¶
func (s *ProxyService) ListProxies(ctx context.Context, opts batproxy.ListProxiesOptions) (page *batproxy.ListProxiesPage, err error)
type ProxyServiceOptions ¶ added in v0.0.3
type ProxyServiceOptions struct {
Suffix string
}
Click to show internal directories.
Click to hide internal directories.