aboutsummaryrefslogtreecommitdiff
path: root/environment_test.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2022-05-22 21:29:35 +0700
committerShulhan <ms@kilabit.info>2022-05-22 21:51:47 +0700
commit0b92dbb8463dee31c005c59f67c2bf754a9eae12 (patch)
treea95162fc3aaa88ce772f9b7c8b79747c225a0ba8 /environment_test.go
parent89494ecacdd03426da17def52e35a1a66c9630eb (diff)
downloadrescached-0b92dbb8463dee31c005c59f67c2bf754a9eae12.tar.xz
all: export and rename the hostsBlock type to Blockd
In the Environment, we have a field HostsBlocks that reference an unexported type hostsFile. In order for any package to be able to use this field, we need to export this type. While at it, we rename the type from hostsBlock to Blockd to make it simple and consistent with name.
Diffstat (limited to 'environment_test.go')
-rw-r--r--environment_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/environment_test.go b/environment_test.go
index 4c3393e..99d0950 100644
--- a/environment_test.go
+++ b/environment_test.go
@@ -73,16 +73,16 @@ func TestLoadEnvironment(t *testing.T) {
fileConfig: filepath.Join(testDirBase, "/etc/rescached/rescached.cfg"),
WUIListen: "127.0.0.1:5381",
- HostsBlocks: map[string]*hostsBlock{
- "pgl.yoyo.org": &hostsBlock{
+ HostBlockd: map[string]*Blockd{
+ "pgl.yoyo.org": &Blockd{
Name: "pgl.yoyo.org",
URL: `http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&startdate[day]=&startdate[month]=&startdate[year]=&mimetype=plaintext`,
},
- "winhelp2002.mvps.org": &hostsBlock{
+ "winhelp2002.mvps.org": &Blockd{
Name: "winhelp2002.mvps.org",
URL: `http://winhelp2002.mvps.org/hosts.txt`,
},
- "someonewhocares.org": &hostsBlock{
+ "someonewhocares.org": &Blockd{
Name: "someonewhocares.org",
URL: `http://someonewhocares.org/hosts/hosts`,
},
@@ -120,7 +120,7 @@ func TestLoadEnvironment(t *testing.T) {
test.Assert(t, "LoadEnvironment", expEnv, gotEnv)
- gotEnv.HostsBlocks["test"] = &hostsBlock{
+ gotEnv.HostBlockd["test"] = &Blockd{
Name: "test",
URL: "http://someurl",
}