rename to ipchub

This commit is contained in:
notch
2020-12-14 09:05:52 +08:00
parent 4508302351
commit 2c8ac84a41
22 changed files with 27 additions and 67 deletions

2
.gitignore vendored
View File

@@ -10,7 +10,7 @@ logs
bin bin
# file # file
tomatox ipchub
routetable.json routetable.json
users.json users.json

6
.vscode/launch.json vendored
View File

@@ -5,7 +5,7 @@
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": "tomatox", "name": "ipchub",
"type": "go", "type": "go",
"request": "launch", "request": "launch",
"mode": "auto", "mode": "auto",
@@ -14,7 +14,7 @@
"args": [] "args": []
}, },
{ {
"name": "tomatox -log-tofile", "name": "ipchub -log-tofile",
"type": "go", "type": "go",
"request": "launch", "request": "launch",
"mode": "auto", "mode": "auto",
@@ -23,7 +23,7 @@
"args": ["-log-tofile"] "args": ["-log-tofile"]
}, },
{ {
"name": "tomatox -h", "name": "ipchub -h",
"type": "go", "type": "go",
"request": "launch", "request": "launch",
"mode": "auto", "mode": "auto",

View File

@@ -1,2 +1,2 @@
# tomatox # ipchub
一个小而美的流媒体服务器 一个小而美的流媒体服务器

View File

@@ -12,16 +12,16 @@ import (
"strings" "strings"
"time" "time"
"github.com/cnotch/ipchub/provider/auth"
"github.com/cnotch/ipchub/utils"
cfg "github.com/cnotch/loader" cfg "github.com/cnotch/loader"
"github.com/cnotch/tomatox/provider/auth"
"github.com/cnotch/tomatox/utils"
"github.com/cnotch/xlog" "github.com/cnotch/xlog"
) )
// 服务名 // 服务名
const ( const (
Vendor = "CAOHONGJU" Vendor = "CAOHONGJU"
Name = "tomatox" Name = "ipchub"
Version = "V1.0.0" Version = "V1.0.0"
) )

View File

@@ -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")
}

View File

@@ -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")
}

2
go.mod
View File

@@ -1,4 +1,4 @@
module github.com/cnotch/tomatox module github.com/cnotch/ipchub
go 1.14 go 1.14

View File

@@ -6,7 +6,7 @@
"log": { "log": {
"level": "INFO", "level": "INFO",
"tofile": false, "tofile": false,
"filename": "./logs/tomatox.log", "filename": "./logs/ipchub.log",
"maxsize": 20, "maxsize": 20,
"maxdays": 7, "maxdays": 7,
"maxbackups": 14, "maxbackups": 14,

View File

@@ -5,10 +5,10 @@
package main package main
import ( 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/scheduler"
"github.com/cnotch/tomatox/config"
"github.com/cnotch/tomatox/provider/auth"
"github.com/cnotch/tomatox/provider/route"
"github.com/cnotch/xlog" "github.com/cnotch/xlog"
) )

View File

@@ -5,7 +5,7 @@ GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get GOGET=$(GOCMD) get
ENABLED_CGO=0 ENABLED_CGO=0
BINARY_NAME=tomatox BINARY_NAME=ipchub
BINARY_DIR= bin/v1.0.0 BINARY_DIR= bin/v1.0.0
build: build:

View File

@@ -5,7 +5,7 @@
package rtp package rtp
import ( import (
"github.com/cnotch/tomatox/av/h264" "github.com/cnotch/ipchub/av/h264"
) )
type h264FrameExtractor struct { type h264FrameExtractor struct {

View File

@@ -7,7 +7,7 @@ package rtp
import ( import (
"fmt" "fmt"
"github.com/cnotch/tomatox/av/aac" "github.com/cnotch/ipchub/av/aac"
) )
type mpesFrameExtractor struct { type mpesFrameExtractor struct {

View File

@@ -14,7 +14,7 @@ import (
"net/url" "net/url"
"strings" "strings"
"github.com/cnotch/tomatox/utils/scan" "github.com/cnotch/ipchub/utils/scan"
) )
const ( const (

View File

@@ -11,7 +11,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/cnotch/tomatox/utils/scan" "github.com/cnotch/ipchub/utils/scan"
) )
// RTSP 响应状态码. // RTSP 响应状态码.

View File

@@ -11,7 +11,7 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"github.com/cnotch/tomatox/utils" "github.com/cnotch/ipchub/utils"
) )
// JSON json 提供者 // JSON json 提供者

View File

@@ -8,7 +8,7 @@ import (
"strings" "strings"
"unicode" "unicode"
"github.com/cnotch/tomatox/utils/scan" "github.com/cnotch/ipchub/utils/scan"
) )
const ( const (

View File

@@ -8,7 +8,7 @@ import (
"sync" "sync"
"time" "time"
"github.com/cnotch/tomatox/provider/security" "github.com/cnotch/ipchub/provider/security"
) )
// Token 用户登录后的Token // Token 用户登录后的Token

View File

@@ -10,7 +10,7 @@ import (
"errors" "errors"
"strings" "strings"
"github.com/cnotch/tomatox/utils/scan" "github.com/cnotch/ipchub/utils/scan"
) )
// AccessRight 访问权限类型 // AccessRight 访问权限类型

View File

@@ -11,7 +11,7 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"github.com/cnotch/tomatox/utils" "github.com/cnotch/ipchub/utils"
) )
// JSON json 提供者 // JSON json 提供者

View File

@@ -7,7 +7,7 @@ package route
import ( import (
"net/url" "net/url"
"github.com/cnotch/tomatox/utils" "github.com/cnotch/ipchub/utils"
) )
// Route 路由 // Route 路由

View File

@@ -7,7 +7,7 @@ package route
import ( import (
"sync" "sync"
"github.com/cnotch/tomatox/utils" "github.com/cnotch/ipchub/utils"
"github.com/cnotch/xlog" "github.com/cnotch/xlog"
) )

View File

@@ -22,7 +22,7 @@ import (
// BenchmarkOf-8 100000000 14.5 ns/op 0 B/op 0 allocs/op // BenchmarkOf-8 100000000 14.5 ns/op 0 B/op 0 allocs/op
func BenchmarkOf(b *testing.B) { 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.ReportAllocs()
b.ResetTimer() b.ResetTimer()
@@ -33,7 +33,7 @@ func BenchmarkOf(b *testing.B) {
// BenchmarkOfString-8 100000000 18.4 ns/op 0 B/op 0 allocs/op // BenchmarkOfString-8 100000000 18.4 ns/op 0 B/op 0 allocs/op
func BenchmarkOfString(b *testing.B) { 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.ReportAllocs()
b.ResetTimer() b.ResetTimer()