manager

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2017 License: Apache-2.0 Imports: 11 Imported by: 5

Documentation

Overview

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FixDirSeparator

func FixDirSeparator(dir string) string

Types

type Manager

type Manager struct {
	Caches map[string][]byte

	RootDir      string
	NewRoorDir   string
	Ignores      map[string]bool
	CachedAllows map[string]bool
	Logger       logger.Logger
	Preprocessor func([]byte) []byte

	TimerCallback func() bool

	OnChangeCallback func(string, string, string) //参数为:目标名称,类型(file/dir),事件名(create/delete/modify/rename)
	// contains filtered or unexported fields
}

func New added in v1.1.0

func New(logger logger.Logger, tmplDir string, allows []string, callback func(name, typ, event string), cached ...bool) *Manager

func (*Manager) CacheDelete

func (self *Manager) CacheDelete(tmpl string)

func (*Manager) CacheTemplate

func (self *Manager) CacheTemplate(tmpl string, content []byte)

func (*Manager) ClearCache

func (self *Manager) ClearCache()

func (*Manager) Close

func (self *Manager) Close()

func (*Manager) GetTemplate

func (self *Manager) GetTemplate(tmpl string) ([]byte, error)

func (*Manager) Init

func (self *Manager) Init(logger logger.Logger, rootDir string, reload bool, allows ...string)

func (*Manager) Moniter

func (self *Manager) Moniter(rootDir string) error

func (*Manager) SetLogger added in v1.1.0

func (self *Manager) SetLogger(logger logger.Logger)

func (*Manager) SetOnChangeCallback added in v1.1.0

func (self *Manager) SetOnChangeCallback(callback func(name, typ, event string))

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL