Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultFileProvider(srv *LogServer, filename string, file *File) (err error)
- func InitLog(level logging.Level) *logging.Logger
- func ParseConfigValue(dest interface{}, value interface{}, ...) (interface{}, error)
- func SampleConfig() string
- type Client
- type File
- type FileFollowChan
- type Files
- type Follow
- type LogServer
- func (s *LogServer) ConfigString() string
- func (s *LogServer) LoadConfig() (err error)
- func (s *LogServer) LoadConfigFromStringMap(m map[string]string) (err error)
- func (s *LogServer) NewFiles() *Files
- func (s *LogServer) ParseConfig(cfg map[string]interface{}) (err error)
- func (s *LogServer) PrintConfig()
- func (g *LogServer) Route(path string) string
- func (s *LogServer) SetServerUrl(serverUrl string) error
- type Message
- type Password
- type Sender
Constants ¶
View Source
const ( OUT = 0 ERR = 1 GLOBAL_ERR = 2 CLIENT_CLOSE = 3 FLASH = 4 FILE_INFO = 5 FOLLOW = 6 )
View Source
const LOG_NAME = "[LogServer] "
Variables ¶
View Source
var Log = logging.MustGetLogger(LOG_NAME)
Functions ¶
func DefaultFileProvider ¶
func ParseConfigValue ¶
func SampleConfig ¶
func SampleConfig() string
Types ¶
type Client ¶
type Client struct { Sender *Sender Id int Fc *FileFollowChan Closed bool TimeOut <-chan time.Time CloseTimeOut <-chan time.Time // contains filtered or unexported fields }
func (*Client) RenewTimeout ¶
func (client *Client) RenewTimeout()
type File ¶
type File struct { Key string Info string OutPath string ErrPath string OutKey string ErrKey string Written *util.IsWritenResult FollowRequireWritten bool // contains filtered or unexported fields }
func (*File) CheckFollow ¶
type FileFollowChan ¶
type FileFollowChan struct { Files *Files File *File LastId int Chan chan string Clients map[int]*Client LastTailId int Follow *Follow ClientsMonitor []chan bool }
func (*FileFollowChan) ClientMonitor ¶
func (fc *FileFollowChan) ClientMonitor() chan bool
func (*FileFollowChan) IsWritten ¶
func (fc *FileFollowChan) IsWritten() bool
func (*FileFollowChan) Send ¶
func (fc *FileFollowChan) Send(t int, line interface{})
func (*FileFollowChan) Start ¶
func (fc *FileFollowChan) Start()
type Files ¶
type Files struct { Server *LogServer Files map[string]*FileFollowChan Timer chan bool }
type Follow ¶
type Follow struct { Fc *FileFollowChan Id int Running int KillChans []chan bool }
func (*Follow) KillMonitor ¶
type LogServer ¶
type LogServer struct { SiteName string SiteTitle string ServerAddr string ServerUrl string SockPerms int UnixSocket bool Path string LogLevel logging.Level M *macaron.Macaron PrepareServer func(srv *LogServer) (err error) FileProvider func(srv *LogServer, filename string, file *File) (err error) RequestFileProvider func(files *Files, ctx *macaron.Context, filename string) (*File, error) HomeHandler interface{} Files *Files Log *logging.Logger Data map[string]interface{} RootPath string ConfigFile string OtherConfigFiles []interface{} Config *ini.File Dev bool }
func (*LogServer) ConfigString ¶
func (*LogServer) LoadConfig ¶
func (*LogServer) LoadConfigFromStringMap ¶
func (*LogServer) ParseConfig ¶
func (*LogServer) PrintConfig ¶
func (s *LogServer) PrintConfig()
func (*LogServer) SetServerUrl ¶
Click to show internal directories.
Click to hide internal directories.