move worker constants to constants.go, filetype type defintion to filesystem.go

Signed-off-by: kim (grufwub) <grufwub@gmail.com>
master
kim (grufwub) 4 years ago
parent f9b0206aff
commit 1c119afa1c

@ -4,6 +4,11 @@ const (
/* Gophor */
GophorVersion = "0.5-alpha-PR3"
/* Socket settings */
SocketReadBufSize = 256 /* Supplied selector shouldn't be longer than this anyways */
MaxSocketReadChunks = 1
FileReadBufSize = 1024
/* Parsing */
DOSLineEnd = "\r\n"
UnixLineEnd = "\n"
@ -12,6 +17,7 @@ const (
Tab = "\t"
LastLine = End+DOSLineEnd
/* Line creation */
MaxUserNameLen = 70 /* RFC 1436 standard */
MaxSelectorLen = 255 /* RFC 1436 standard */
@ -22,6 +28,7 @@ const (
SelectorErrorStr = "selector_length_error"
GophermapRenderErrorStr = ""
/* Replacement strings */
ReplaceStrHostname = "$hostname"
ReplaceStrPort = "$port"

@ -4,14 +4,18 @@ import (
"os"
"sync"
"path"
"bytes"
"time"
"io"
"sort"
"bufio"
"strings"
)
type FileType int
const (
/* Leads to some more concise code below */
FileTypeRegular FileType = iota
FileTypeDir FileType = iota
FileTypeBad FileType = iota
)
/* FileSystem:
* Object to hold and help manage our file cache. Uses a fixed map
* as a means of easily collecting files by path, but also being able

@ -2,14 +2,11 @@ package main
import (
"os"
"sync"
"path"
"bytes"
"time"
"io"
"sort"
"bufio"
"strings"
)
/* Perform simple buffered read on a file at path */

@ -5,18 +5,6 @@ import (
"strings"
)
type FileType int
const (
SocketReadBufSize = 256 /* Supplied selector shouldn't be longer than this anyways */
MaxSocketReadChunks = 4
FileReadBufSize = 1024
/* Leads to some more concise code below */
FileTypeRegular FileType = iota
FileTypeDir FileType = iota
FileTypeBad FileType = iota
)
type Worker struct {
Conn *GophorConn
}

Loading…
Cancel
Save