Compare commits
No commits in common. "74c9bf36fd87a0a271bbb93204c0fc485d293cf7" and "47f14f94ab700b90996154703bfdd3c61d6d7523" have entirely different histories.
74c9bf36fd
...
47f14f94ab
@ -29,7 +29,7 @@ func Init(addr, username, password string, database int) {
|
||||
|
||||
var cli *asynq.Client
|
||||
|
||||
func GetClient() *asynq.Client {
|
||||
func Client() *asynq.Client {
|
||||
onceCli.Do(func() {
|
||||
cli = asynq.NewClient(redisOpt)
|
||||
})
|
||||
@ -38,7 +38,7 @@ func GetClient() *asynq.Client {
|
||||
|
||||
var svc *asynq.Server
|
||||
|
||||
func GetServerWithArgs(concurrency int, fn asynq.ErrorHandlerFunc) *asynq.Server {
|
||||
func ServerWithArgs(concurrency int, fn asynq.ErrorHandlerFunc) *asynq.Server {
|
||||
onceSvc.Do(func() {
|
||||
svc = asynq.NewServer(
|
||||
redisOpt,
|
||||
@ -51,7 +51,7 @@ func GetServerWithArgs(concurrency int, fn asynq.ErrorHandlerFunc) *asynq.Server
|
||||
return svc
|
||||
}
|
||||
|
||||
func GetServerWithConfig(cfg asynq.Config) *asynq.Server {
|
||||
func ServerWithConfig(cfg asynq.Config) *asynq.Server {
|
||||
onceSvc.Do(func() {
|
||||
svc = asynq.NewServer(
|
||||
redisOpt,
|
||||
@ -61,7 +61,7 @@ func GetServerWithConfig(cfg asynq.Config) *asynq.Server {
|
||||
return svc
|
||||
}
|
||||
|
||||
func GetServer() *asynq.Server {
|
||||
func Server() *asynq.Server {
|
||||
onceSvc.Do(func() {
|
||||
svc = asynq.NewServer(
|
||||
redisOpt,
|
||||
|
@ -1,30 +0,0 @@
|
||||
//
|
||||
// wrapper.go
|
||||
// Copyright (C) 2023 tiglog <me@tiglog.com>
|
||||
//
|
||||
// Distributed under terms of the MIT license.
|
||||
//
|
||||
|
||||
package gqueue
|
||||
|
||||
import "github.com/hibiken/asynq"
|
||||
|
||||
type Task = asynq.Task
|
||||
type Client = asynq.Client
|
||||
type Server = asynq.Server
|
||||
|
||||
var GetRetryCount = asynq.GetRetryCount
|
||||
var GetTaskID = asynq.GetTaskID
|
||||
var GetQueueName = asynq.GetQueueName
|
||||
var GetMaxRetry = asynq.GetMaxRetry
|
||||
|
||||
var ProcessIn = asynq.ProcessIn
|
||||
var ProcessAt = asynq.ProcessAt
|
||||
|
||||
var MaxRetry = asynq.MaxRetry
|
||||
var Timeout = asynq.Timeout
|
||||
var SkipRetry = asynq.SkipRetry
|
||||
|
||||
var NewTask = asynq.NewTask
|
||||
var NewServeMux = asynq.NewServeMux
|
||||
var NewClient = asynq.NewClient
|
18
gweb/gin.go
18
gweb/gin.go
@ -16,8 +16,26 @@ import (
|
||||
"os/signal"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type Engine = gin.Engine
|
||||
|
||||
type Context = gin.Context
|
||||
|
||||
type H = gin.H
|
||||
|
||||
const (
|
||||
ReleaseMode = gin.ReleaseMode
|
||||
DebugMode = gin.DebugMode
|
||||
TestMode = gin.TestMode
|
||||
)
|
||||
|
||||
var New = gin.New
|
||||
var SetMode = gin.SetMode
|
||||
var Mode = gin.Mode
|
||||
|
||||
func RunWeb(app *Engine, addr string) {
|
||||
if addr[0] == ':' {
|
||||
addr = "127.0.0.1" + addr
|
||||
|
@ -1,26 +0,0 @@
|
||||
//
|
||||
// wrapper.go
|
||||
// Copyright (C) 2023 tiglog <me@tiglog.com>
|
||||
//
|
||||
// Distributed under terms of the MIT license.
|
||||
//
|
||||
|
||||
package gweb
|
||||
|
||||
import "github.com/gin-gonic/gin"
|
||||
|
||||
type Engine = gin.Engine
|
||||
|
||||
type Context = gin.Context
|
||||
|
||||
type H = gin.H
|
||||
|
||||
const (
|
||||
ReleaseMode = gin.ReleaseMode
|
||||
DebugMode = gin.DebugMode
|
||||
TestMode = gin.TestMode
|
||||
)
|
||||
|
||||
var New = gin.New
|
||||
var SetMode = gin.SetMode
|
||||
var Mode = gin.Mode
|
Loading…
Reference in New Issue
Block a user