Skip to content

Commit

Permalink
chore: fix misspelling
Browse files Browse the repository at this point in the history
  • Loading branch information
soulteary committed Nov 30, 2022
1 parent 64f09e1 commit 80489ea
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions internal/define/alpine.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const ALPINE_BENCHMAKR_URL = "MIRRORS.txt"

// https://mirrors.alpinelinux.org/ 2022.11.19
// Sites that contain protocol headers, restrict access to resources using that protocol
var ALPINE_OFFICAL_MIRRORS = []string{
var ALPINE_OFFICIAL_MIRRORS = []string{
"mirrors.tuna.tsinghua.edu.cn/alpine/",
"mirrors.ustc.edu.cn/alpine/",
"mirrors.nju.edu.cn/alpine/",
Expand All @@ -21,7 +21,7 @@ var ALPINE_OFFICAL_MIRRORS = []string{

var ALPINE_CUSTOM_MIRRORS = []string{}

var BUILDIN_ALPINE_MIRRORS = GenerateBuildInList(ALPINE_OFFICAL_MIRRORS, ALPINE_CUSTOM_MIRRORS)
var BUILDIN_ALPINE_MIRRORS = GenerateBuildInList(ALPINE_OFFICIAL_MIRRORS, ALPINE_CUSTOM_MIRRORS)

var ALPINE_DEFAULT_CACHE_RULES = []Rule{
{Pattern: regexp.MustCompile(`APKINDEX.tar.gz$`), CacheControl: `max-age=3600`, Rewrite: true, OS: TYPE_LINUX_DISTROS_ALPINE},
Expand Down
4 changes: 2 additions & 2 deletions internal/define/centos.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const CENTOS_BENCHMAKR_URL = "TIME"

// https://www.centos.org/download/mirrors/ 2022.11.19
// Sites that contain protocol headers, restrict access to resources using that protocol
var CENTOS_OFFICAL_MIRRORS = []string{
var CENTOS_OFFICIAL_MIRRORS = []string{
"mirrors.bfsu.edu.cn/centos/",
"mirrors.cqu.edu.cn/CentOS/",
"http://mirrors.neusoft.edu.cn/centos/",
Expand All @@ -27,7 +27,7 @@ var CENTOS_CUSTOM_MIRRORS = []string{
"mirrors.aliyun.com/centos/",
}

var BUILDIN_CENTOS_MIRRORS = GenerateBuildInList(CENTOS_OFFICAL_MIRRORS, CENTOS_CUSTOM_MIRRORS)
var BUILDIN_CENTOS_MIRRORS = GenerateBuildInList(CENTOS_OFFICIAL_MIRRORS, CENTOS_CUSTOM_MIRRORS)

var CENTOS_DEFAULT_CACHE_RULES = []Rule{
{Pattern: regexp.MustCompile(`repomd.xml$`), CacheControl: `max-age=3600`, Rewrite: true, OS: TYPE_LINUX_DISTROS_CENTOS},
Expand Down
4 changes: 2 additions & 2 deletions internal/define/debian.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var DEBIAN_HOST_PATTERN = regexp.MustCompile(`/debian/(.+)$`)

// https://www.debian.org/mirror/list 2022.11.19
// Sites that contain protocol headers, restrict access to resources using that protocol
var DEBIAN_OFFICAL_MIRRORS = []string{
var DEBIAN_OFFICIAL_MIRRORS = []string{
"http://ftp.cn.debian.org/debian/",
"mirror.bjtu.edu.cn/debian/",
"mirrors.163.com/debian/",
Expand All @@ -30,7 +30,7 @@ var DEBIAN_CUSTOM_MIRRORS = []string{
"mirror.nju.edu.cn/debian/",
}

var BUILDIN_DEBIAN_MIRRORS = GenerateBuildInList(DEBIAN_OFFICAL_MIRRORS, DEBIAN_CUSTOM_MIRRORS)
var BUILDIN_DEBIAN_MIRRORS = GenerateBuildInList(DEBIAN_OFFICIAL_MIRRORS, DEBIAN_CUSTOM_MIRRORS)

var DEBIAN_DEFAULT_CACHE_RULES = []Rule{
{Pattern: regexp.MustCompile(`deb$`), CacheControl: `max-age=100000`, Rewrite: true, OS: TYPE_LINUX_DISTROS_DEBIAN},
Expand Down
4 changes: 2 additions & 2 deletions internal/define/define.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ func GenerateAliasFromURL(url string) string {
return "cn:" + group[len(group)-1]
}

func GenerateBuildInMirorItem(url string, offical bool) UrlWithAlias {
func GenerateBuildInMirorItem(url string, official bool) UrlWithAlias {
var mirror UrlWithAlias
mirror.Official = offical
mirror.Official = official
mirror.Alias = GenerateAliasFromURL(url)

if strings.HasPrefix(url, "http://") {
Expand Down
4 changes: 2 additions & 2 deletions internal/define/define_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ func TestGenerateBuildInMirorItem(t *testing.T) {
}

func TestGenerateBuildInList(t *testing.T) {
mirrors := Define.GenerateBuildInList(Define.UBUNTU_OFFICAL_MIRRORS, Define.UBUNTU_CUSTOM_MIRRORS)
mirrors := Define.GenerateBuildInList(Define.UBUNTU_OFFICIAL_MIRRORS, Define.UBUNTU_CUSTOM_MIRRORS)

count := 0
for _, url := range Define.UBUNTU_OFFICAL_MIRRORS {
for _, url := range Define.UBUNTU_OFFICIAL_MIRRORS {
if strings.HasPrefix(url, "http://") || strings.HasPrefix(url, "https://") {
count += 1
} else {
Expand Down
8 changes: 4 additions & 4 deletions internal/define/mirror_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package define_test

// func TestPrintUbuntuPingScript(t *testing.T) {
// for _, url := range Define.UBUNTU_OFFICAL_MIRRORS {
// for _, url := range Define.UBUNTU_OFFICIAL_MIRRORS {
// if !(strings.HasPrefix(url, "http://") || strings.HasPrefix(url, "https://")) {
// fmt.Println(`echo "` + url + `"`)
// http := "curl --connect-timeout 2 -I http://" + url + Define.UBUNTU_BENCHMAKR_URL
Expand All @@ -22,7 +22,7 @@ package define_test
// }

// func TestPrintDebianPingScript(t *testing.T) {
// for _, url := range Define.DEBIAN_OFFICAL_MIRRORS {
// for _, url := range Define.DEBIAN_OFFICIAL_MIRRORS {
// if !(strings.HasPrefix(url, "http://") || strings.HasPrefix(url, "https://")) {
// fmt.Println(`echo "` + url + `"`)
// http := "curl --connect-timeout 2 -I http://" + url + Define.DEBIAN_BENCHMAKR_URL
Expand All @@ -43,7 +43,7 @@ package define_test
// }

// func TestPrintCentosPingScript(t *testing.T) {
// for _, url := range Define.CENTOS_OFFICAL_MIRRORS {
// for _, url := range Define.CENTOS_OFFICIAL_MIRRORS {
// if !(strings.HasPrefix(url, "http://") || strings.HasPrefix(url, "https://")) {
// fmt.Println(`echo "` + url + `"`)
// http := "curl --connect-timeout 2 -I http://" + url + Define.CENTOS_BENCHMAKR_URL
Expand All @@ -64,7 +64,7 @@ package define_test
// }

// func TestPrintCentosPingScript(t *testing.T) {
// for _, url := range Define.ALPINE_OFFICAL_MIRRORS {
// for _, url := range Define.ALPINE_OFFICIAL_MIRRORS {
// if !(strings.HasPrefix(url, "http://") || strings.HasPrefix(url, "https://")) {
// fmt.Println(`echo "` + url + `"`)
// http := "curl --connect-timeout 2 -I http://" + url + Define.ALPINE_BENCHMAKR_URL
Expand Down
4 changes: 2 additions & 2 deletions internal/define/ubuntu.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var UBUNTU_HOST_PATTERN = regexp.MustCompile(`/ubuntu/(.+)$`)

// http://mirrors.ubuntu.com/mirrors.txt 2022.11.19
// Sites that contain protocol headers, restrict access to resources using that protocol
var UBUNTU_OFFICAL_MIRRORS = []string{
var UBUNTU_OFFICIAL_MIRRORS = []string{
"mirrors.cn99.com/ubuntu/",
"mirrors.tuna.tsinghua.edu.cn/ubuntu/",
"mirrors.cnnic.cn/ubuntu/",
Expand Down Expand Up @@ -46,7 +46,7 @@ var UBUNTU_CUSTOM_MIRRORS = []string{
"mirrors.163.com/ubuntu/",
}

var BUILDIN_UBUNTU_MIRRORS = GenerateBuildInList(UBUNTU_OFFICAL_MIRRORS, UBUNTU_CUSTOM_MIRRORS)
var BUILDIN_UBUNTU_MIRRORS = GenerateBuildInList(UBUNTU_OFFICIAL_MIRRORS, UBUNTU_CUSTOM_MIRRORS)

var UBUNTU_DEFAULT_CACHE_RULES = []Rule{
{Pattern: regexp.MustCompile(`deb$`), CacheControl: `max-age=100000`, Rewrite: true, OS: TYPE_LINUX_DISTROS_UBUNTU},
Expand Down

0 comments on commit 80489ea

Please sign in to comment.