-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clean: Cleanup code for Serving the http server
- Loading branch information
Showing
8 changed files
with
78 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
//go:build !skip | ||
|
||
package server | ||
|
||
import ( | ||
_ "embed" | ||
"testing" | ||
) | ||
|
||
func TestServe(t *testing.T) { | ||
type args struct { | ||
port int | ||
} | ||
tests := []struct { | ||
name string | ||
args args | ||
wantErr bool | ||
}{ | ||
{"invalid port", args{port: -1}, true}, | ||
{"invalid port", args{port: 1_000_000}, true}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
if err := Serve(tt.args.port); (err != nil) != tt.wantErr { | ||
t.Errorf("Serve() error = %v, wantErr %v", err, tt.wantErr) | ||
} | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# API Version also used to protect against API or Schema changes | ||
# Actually, the available API versions are: 1 | ||
apiVersion: 1 | ||
# List of your proxies | ||
# You can add as many proxies as you want with logic: | ||
# 1 proxy per final domain | ||
proxies: | ||
- # namespace is the domain name used for following entries | ||
# This can be a subdomain, a domain or a full domain name | ||
# subdomain.example.org, example.org or example.org/subdomain | ||
namespace: atomys.lab | ||
# All entries of this namespace will be proxied to the following address | ||
# Key are the name and the entrypoint/path of your proxied packages | ||
# Value is the current URL of your package. The Destination URL must | ||
# end with a valid protocol. | ||
# Allowed protocol are: "bzr", "fossil", "git", "hg", "svn". | ||
entries: | ||
# Will responds to the following URL: atomys.codes/go-proxy | ||
go-proxy: https://github.com/42Atomys/go-proxy.git | ||
# Will responds to the following URL: atomys.codes/dns-updater | ||
dns-updater: https://github.com/42Atomys/dns-updater.git | ||
# Will responds to the following URL: atomys.codes/subpath/gw2api-go | ||
subpath/gw2api-go: https://gitlab.com/Atomys/gw2api-go.git |
File renamed without changes.