file

package
v0.0.0-...-c683906 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2018 License: MIT Imports: 3 Imported by: 8

Documentation

Overview

Package file handles various file operations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

func Open

func Open(file string, append bool) (*Handler, error)

Open function attempts to open a file and returns the handler for said file. This function takes a parameter append which if set to false will truncate the file upon writing to it. The log parameter denotes whether or not to look inside of the log folder when attempting to open a given file.

func (*Handler) Close

func (h *Handler) Close(delete bool) (error, error)

Close function is attached to the current file and will attempt to close the current file. The boolean parameter delete, if set to true, will also attempt to delete the file upon closing it.

func (*Handler) Read

func (h *Handler) Read() ([]byte, error)

Read function is attached to the file handler type and will read the current file.

func (*Handler) Write

func (h *Handler) Write(data string) (int, error)

Write function is attached to the file handler type and will write to the current file.

Jump to

Keyboard shortcuts

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