about summary refs log tree commit diff
path: root/src/channel.go
diff options
context:
space:
mode:
authorEmile <hanemile@protonmail.com>2019-11-02 21:15:42 +0100
committerEmile <hanemile@protonmail.com>2019-11-02 21:15:42 +0100
commit52d650d76d51974c5a893a1b620ec342d808f8e3 (patch)
tree00c844f59b0e30670771c83822f76bf09e864e64 /src/channel.go
parent7db20320180b1c79824bfb63533005ee664f2b43 (diff)
create channels
Diffstat (limited to 'src/channel.go')
-rw-r--r--src/channel.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/channel.go b/src/channel.go
new file mode 100644
index 0000000..11a6257
--- /dev/null
+++ b/src/channel.go
@@ -0,0 +1,24 @@
+package main
+
+import "log"
+
+// registerChannels creats some channels, stores them in a channels struct and returns the struct for futher usage
+func registerChannels() channels {
+	log.Printf("%s Defining channels", green("[i]"))
+
+	// define the channels
+	wordlistChannel := make(chan string)
+	printChannel := make(chan Response)
+	doneChannel := make(chan int)
+
+	// define a channels struct containing the channels
+	channels := channels{
+		wordlistChannel: wordlistChannel,
+		printChannel:    printChannel,
+		doneChannel:     doneChannel,
+	}
+
+	log.Printf("%s Done defining channels", boldGreen("[+]"))
+
+	return channels
+}