Documentation ¶
Index ¶
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func CutKey(key string) string
- func Datestr2ch(epoch int64) string
- func EachFiles(dir string, handler func(dir os.FileInfo) error) error
- func EachIOLine(f io.ReadCloser, handler func(line string, num int) error) error
- func EachLine(path string, handler func(line string, num int) error) error
- func EmbedURL(url string) string
- func Emoji(str string) string
- func Escape(msg string) string
- func EscapeSpace(msg string) string
- func Fclose(f io.Closer)
- func FileDecode(query string) string
- func FileEncode(t, query string) string
- func FindString(s []string, val string) int
- func FromSJIS(b string) string
- func GetBoard(url string) string
- func HasExt(fname, suffix string) bool
- func HasString(s []string, val string) bool
- func IsDir(path string) bool
- func IsFile(path string) bool
- func IsValidImage(mimetype, path string) bool
- func MD5digest(dat string) string
- func MakeThumbnail(encoded []byte, suffix, thumbnailSize string) []byte
- func MustAsset(name string) []byte
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- func StrDecode(query string) string
- func StrEncode(query string) string
- func ToSJIS(b string) string
- func Verify(mesg, testsig, publicKey string) bool
- type ConfList
- type PrivateKey
- type RegexpList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Asset ¶ added in v0.0.3
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶ added in v0.0.3
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶ added in v0.0.3
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetNames ¶ added in v0.0.3
func AssetNames() []string
AssetNames returns the names of the assets.
func Datestr2ch ¶
Datestr2ch converts unixtime str ecpochStr to the certain format string. e.g. 2006/01/02(日) 15:04:05.99
func EachIOLine ¶
EachIOLine iterates each line to a ReadCloser ,calls func and close f.
func FileEncode ¶
FileEncode encodes filename.
>>> file_encode('foo', 'a') 'foo_61' >>> file_encode('foo', '~') 'foo_7E'
func FindString ¶
FindString search the val in ary and returns index. it returns -1 if not found.
func IsValidImage ¶
IsValidImage checks type of path is same as mimetype or not.
func MakeThumbnail ¶
MakeThumbnail makes thumbnail to suffix image format with thumbnailSize.
func MustAsset ¶ added in v0.0.3
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func RestoreAsset ¶ added in v0.0.3
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶ added in v0.0.3
RestoreAssets restores an asset under the given directory recursively
Types ¶
type ConfList ¶
type ConfList struct {
// contains filtered or unexported fields
}
ConfList represents regexp list.
One regexp per one line.
func NewConfList ¶
NewConfList makes a confList instance from path.
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
PrivateKey reppresents private key,
func MakePrivateKey ¶
func MakePrivateKey(keystr string) (*PrivateKey, error)
MakePrivateKey makes privatekey from keystr
func (*PrivateKey) GetKeys ¶
func (p *PrivateKey) GetKeys() (string, string)
GetKeys returns base64 encoded private key
type RegexpList ¶
type RegexpList struct { *ConfList // contains filtered or unexported fields }
RegexpList represents RegExp list.
One regexp per one line.
func NewRegexpList ¶
func NewRegexpList(path string) *RegexpList
NewRegexpList makes a regexpList and regexp.comples each lines in the file.
func (*RegexpList) Check ¶
func (r *RegexpList) Check(target string) bool
Check returns true if target matches one of all regexps or not.