gfcache

package
v1.4.7 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package gfcache provides reading and caching for file contents.

文件缓存.

文件缓存.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBinContents

func GetBinContents(path string) []byte

获得文件内容 []byte

func GetContents

func GetContents(path string) string

获得文件内容 string

func GetSize

func GetSize() int

获得已缓存的文件大小(byte)

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

func New

func New(cap ...int) *Cache

func (*Cache) GetBinContents

func (c *Cache) GetBinContents(path string) []byte

获得文件内容 []byte

func (*Cache) GetCap

func (c *Cache) GetCap() int

获得缓存容量大小(byte)

func (*Cache) GetContents

func (c *Cache) GetContents(path string) string

获得文件内容 string

func (*Cache) GetSize

func (c *Cache) GetSize() int

获得已缓存的文件大小(byte)

func (*Cache) SetCap

func (c *Cache) SetCap(cap int)

设置容量大小(byte)

Jump to

Keyboard shortcuts

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