From 2c8ac84a41b56b422776550483b3324e6aa666cc Mon Sep 17 00:00:00 2001 From: notch Date: Mon, 14 Dec 2020 09:05:52 +0800 Subject: [PATCH] rename to ipchub --- .gitignore | 2 +- .vscode/launch.json | 6 +++--- README.md | 2 +- config/global.go | 6 +++--- config/rtmp.go | 19 ------------------- config/rtsp.go | 21 --------------------- go.mod | 2 +- tomatox.conf => ipchub.conf | 2 +- main.go | 6 +++--- makefile | 2 +- protos/rtp/h264_frame_extractor.go | 2 +- protos/rtp/mpes_frame_extractor.go | 2 +- protos/rtsp/request.go | 2 +- protos/rtsp/response.go | 2 +- provider/auth/json.go | 2 +- provider/auth/path_matcher.go | 2 +- provider/auth/token.go | 2 +- provider/auth/user.go | 2 +- provider/route/json.go | 2 +- provider/route/route.go | 2 +- provider/route/routetable.go | 2 +- utils/murmur/murmur_test.go | 4 ++-- 22 files changed, 27 insertions(+), 67 deletions(-) delete mode 100755 config/rtmp.go delete mode 100755 config/rtsp.go rename tomatox.conf => ipchub.conf (84%) diff --git a/.gitignore b/.gitignore index 5f50b92..0b424e2 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,7 @@ logs bin # file -tomatox +ipchub routetable.json users.json diff --git a/.vscode/launch.json b/.vscode/launch.json index 589bf85..128f438 100755 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,7 +5,7 @@ "version": "0.2.0", "configurations": [ { - "name": "tomatox", + "name": "ipchub", "type": "go", "request": "launch", "mode": "auto", @@ -14,7 +14,7 @@ "args": [] }, { - "name": "tomatox -log-tofile", + "name": "ipchub -log-tofile", "type": "go", "request": "launch", "mode": "auto", @@ -23,7 +23,7 @@ "args": ["-log-tofile"] }, { - "name": "tomatox -h", + "name": "ipchub -h", "type": "go", "request": "launch", "mode": "auto", diff --git a/README.md b/README.md index 81769f6..32c76b8 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -# tomatox +# ipchub 一个小而美的流媒体服务器 diff --git a/config/global.go b/config/global.go index e91c264..013ba50 100755 --- a/config/global.go +++ b/config/global.go @@ -12,16 +12,16 @@ import ( "strings" "time" + "github.com/cnotch/ipchub/provider/auth" + "github.com/cnotch/ipchub/utils" cfg "github.com/cnotch/loader" - "github.com/cnotch/tomatox/provider/auth" - "github.com/cnotch/tomatox/utils" "github.com/cnotch/xlog" ) // 服务名 const ( Vendor = "CAOHONGJU" - Name = "tomatox" + Name = "ipchub" Version = "V1.0.0" ) diff --git a/config/rtmp.go b/config/rtmp.go deleted file mode 100755 index 3423630..0000000 --- a/config/rtmp.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) 2019,CAOHONGJU All rights reserved. -// Use of this source code is governed by a MIT-style -// license that can be found in the LICENSE file. - -package config - -import ( - "flag" -) - -// RtmpConfig rtsp 配置 -type RtmpConfig struct { - ChunkSize int `json:"chunksize"` -} - -func (c *RtmpConfig) initFlags() { - // RTSP 组播 - flag.IntVar(&c.ChunkSize, "rtmp-chunksize", 16*1024, "Set RTMP ChunkSize") -} diff --git a/config/rtsp.go b/config/rtsp.go deleted file mode 100755 index fe02c05..0000000 --- a/config/rtsp.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) 2019,CAOHONGJU All rights reserved. -// Use of this source code is governed by a MIT-style -// license that can be found in the LICENSE file. - -package config - -import ( - "flag" - - "github.com/cnotch/tomatox/provider/auth" -) - -// RtspConfig rtsp 配置 -type RtspConfig struct { - AuthMode auth.Mode `json:"authmode"` -} - -func (c *RtspConfig) initFlags() { - // RTSP 组播 - flag.Var(&c.AuthMode, "rtsp-auth", "Set RTSP auth mode") -} diff --git a/go.mod b/go.mod index e06549a..e7a5199 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/cnotch/tomatox +module github.com/cnotch/ipchub go 1.14 diff --git a/tomatox.conf b/ipchub.conf similarity index 84% rename from tomatox.conf rename to ipchub.conf index c1bbfd2..b2e9305 100755 --- a/tomatox.conf +++ b/ipchub.conf @@ -6,7 +6,7 @@ "log": { "level": "INFO", "tofile": false, - "filename": "./logs/tomatox.log", + "filename": "./logs/ipchub.log", "maxsize": 20, "maxdays": 7, "maxbackups": 14, diff --git a/main.go b/main.go index 0a98296..2b80bc8 100755 --- a/main.go +++ b/main.go @@ -5,10 +5,10 @@ package main import ( + "github.com/cnotch/ipchub/config" + "github.com/cnotch/ipchub/provider/auth" + "github.com/cnotch/ipchub/provider/route" "github.com/cnotch/scheduler" - "github.com/cnotch/tomatox/config" - "github.com/cnotch/tomatox/provider/auth" - "github.com/cnotch/tomatox/provider/route" "github.com/cnotch/xlog" ) diff --git a/makefile b/makefile index 425892a..06b7de1 100755 --- a/makefile +++ b/makefile @@ -5,7 +5,7 @@ GOCLEAN=$(GOCMD) clean GOTEST=$(GOCMD) test GOGET=$(GOCMD) get ENABLED_CGO=0 -BINARY_NAME=tomatox +BINARY_NAME=ipchub BINARY_DIR= bin/v1.0.0 build: diff --git a/protos/rtp/h264_frame_extractor.go b/protos/rtp/h264_frame_extractor.go index bccd3e4..36924c8 100644 --- a/protos/rtp/h264_frame_extractor.go +++ b/protos/rtp/h264_frame_extractor.go @@ -5,7 +5,7 @@ package rtp import ( - "github.com/cnotch/tomatox/av/h264" + "github.com/cnotch/ipchub/av/h264" ) type h264FrameExtractor struct { diff --git a/protos/rtp/mpes_frame_extractor.go b/protos/rtp/mpes_frame_extractor.go index cb725b0..cda59b1 100644 --- a/protos/rtp/mpes_frame_extractor.go +++ b/protos/rtp/mpes_frame_extractor.go @@ -7,7 +7,7 @@ package rtp import ( "fmt" - "github.com/cnotch/tomatox/av/aac" + "github.com/cnotch/ipchub/av/aac" ) type mpesFrameExtractor struct { diff --git a/protos/rtsp/request.go b/protos/rtsp/request.go index 530d082..c90bc9e 100755 --- a/protos/rtsp/request.go +++ b/protos/rtsp/request.go @@ -14,7 +14,7 @@ import ( "net/url" "strings" - "github.com/cnotch/tomatox/utils/scan" + "github.com/cnotch/ipchub/utils/scan" ) const ( diff --git a/protos/rtsp/response.go b/protos/rtsp/response.go index 38c543f..e4f286e 100755 --- a/protos/rtsp/response.go +++ b/protos/rtsp/response.go @@ -11,7 +11,7 @@ import ( "strconv" "strings" - "github.com/cnotch/tomatox/utils/scan" + "github.com/cnotch/ipchub/utils/scan" ) // RTSP 响应状态码. diff --git a/provider/auth/json.go b/provider/auth/json.go index 8c137a1..9198518 100755 --- a/provider/auth/json.go +++ b/provider/auth/json.go @@ -11,7 +11,7 @@ import ( "os" "path/filepath" - "github.com/cnotch/tomatox/utils" + "github.com/cnotch/ipchub/utils" ) // JSON json 提供者 diff --git a/provider/auth/path_matcher.go b/provider/auth/path_matcher.go index aa2682c..73ed549 100755 --- a/provider/auth/path_matcher.go +++ b/provider/auth/path_matcher.go @@ -8,7 +8,7 @@ import ( "strings" "unicode" - "github.com/cnotch/tomatox/utils/scan" + "github.com/cnotch/ipchub/utils/scan" ) const ( diff --git a/provider/auth/token.go b/provider/auth/token.go index c5e3f3c..0d2370b 100755 --- a/provider/auth/token.go +++ b/provider/auth/token.go @@ -8,7 +8,7 @@ import ( "sync" "time" - "github.com/cnotch/tomatox/provider/security" + "github.com/cnotch/ipchub/provider/security" ) // Token 用户登录后的Token diff --git a/provider/auth/user.go b/provider/auth/user.go index 9cbd609..d9e9e19 100755 --- a/provider/auth/user.go +++ b/provider/auth/user.go @@ -10,7 +10,7 @@ import ( "errors" "strings" - "github.com/cnotch/tomatox/utils/scan" + "github.com/cnotch/ipchub/utils/scan" ) // AccessRight 访问权限类型 diff --git a/provider/route/json.go b/provider/route/json.go index f6863ea..e539c42 100755 --- a/provider/route/json.go +++ b/provider/route/json.go @@ -11,7 +11,7 @@ import ( "os" "path/filepath" - "github.com/cnotch/tomatox/utils" + "github.com/cnotch/ipchub/utils" ) // JSON json 提供者 diff --git a/provider/route/route.go b/provider/route/route.go index 4a0a40c..0845133 100755 --- a/provider/route/route.go +++ b/provider/route/route.go @@ -7,7 +7,7 @@ package route import ( "net/url" - "github.com/cnotch/tomatox/utils" + "github.com/cnotch/ipchub/utils" ) // Route 路由 diff --git a/provider/route/routetable.go b/provider/route/routetable.go index f5091e3..19b45f7 100755 --- a/provider/route/routetable.go +++ b/provider/route/routetable.go @@ -7,7 +7,7 @@ package route import ( "sync" - "github.com/cnotch/tomatox/utils" + "github.com/cnotch/ipchub/utils" "github.com/cnotch/xlog" ) diff --git a/utils/murmur/murmur_test.go b/utils/murmur/murmur_test.go index 08f9c97..d88c009 100644 --- a/utils/murmur/murmur_test.go +++ b/utils/murmur/murmur_test.go @@ -22,7 +22,7 @@ import ( // BenchmarkOf-8 100000000 14.5 ns/op 0 B/op 0 allocs/op func BenchmarkOf(b *testing.B) { - v := []byte("a/b/c/d/e/f/g/h/this/is/tomatox") + v := []byte("a/b/c/d/e/f/g/h/this/is/ipchub") b.ReportAllocs() b.ResetTimer() @@ -33,7 +33,7 @@ func BenchmarkOf(b *testing.B) { // BenchmarkOfString-8 100000000 18.4 ns/op 0 B/op 0 allocs/op func BenchmarkOfString(b *testing.B) { - v := "a/b/c/d/e/f/g/h/this/is/tomatox" + v := "a/b/c/d/e/f/g/h/this/is/ipchub" b.ReportAllocs() b.ResetTimer()