file

package
v0.0.0-...-4c1a193 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2019 License: MIT Imports: 6 Imported by: 4

Documentation

Overview

Package file is meant to take care of all asset file opening so that file access is safe if trying to access a bundled file or a file from the disk

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ext

func Ext(filename string) string

Ext will return the extention of the file

func Open

func Open(path string) (io.ReadCloser, error)

Open will return the file if its bundled or on disk and return a File interface for the file and an error if it does not exist. The File interface allows for consitent access to disk files and zip files.

func Read

func Read(path string) ([]byte, error)

Read will read a file at the path specified in total and return a byte array of the file contents

func ReadString

func ReadString(filename string) string

ReadString acts like Read but instead return a string. This is useful in certain circumstances.

func Register

func Register(data string)

Register will be called by bundled assets to register the bundled files into the zip file data to be used by the program.

Types

This section is empty.

Jump to

Keyboard shortcuts

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