dos

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

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

Go to latest
Published: Apr 16, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

dos abbreviations for "Default Operating System"

Index

Constants

This section is empty.

Variables

View Source
var OS os

OS implements protocol.OperatingSystem

Functions

func SortFilesDec

func SortFilesDec(repoFiles []goos.FileInfo)

SortFilesDec sort given slice in dec

Types

type ByModTime

type ByModTime []goos.FileInfo

ByModTime use to

func (ByModTime) Len

func (fis ByModTime) Len() int

func (ByModTime) Less

func (fis ByModTime) Less(i, j int) bool

func (ByModTime) Swap

func (fis ByModTime) Swap(i, j int)

type File

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

File store some data about a file!

func (*File) Append

func (f *File) Append(data []byte)

Append append given data to end of exiting data that add earlier

func (*File) Compress

func (f *File) Compress(compressType string)

Compress use to compress file data to mostly to use in serving file by servers.

func (*File) CompressType

func (f *File) CompressType() string

func (*File) Data

func (f *File) Data() protocol.FileData

func (*File) Decode

func (f *File) Decode(reader io.Reader) (err protocol.Error)

func (*File) Encode

func (f *File) Encode(writer io.Writer) (err error)

Encode write file to given writer

func (*File) Len

func (f *File) Len() (ln int)

Len return length of file

func (*File) Marshal

func (f *File) Marshal() (data []byte)

Marshal enecodes and return whole file data!

func (*File) MarshalTo

func (f *File) MarshalTo(data []byte) []byte

MarshalTo enecodes whole file data to given data and return it with new len!

func (*File) MediaType

func (f *File) MediaType() string

func (*File) MetaData

func (f *File) MetaData() protocol.FileMetaData

func (*File) Minify

func (f *File) Minify() (err protocol.Error)

Minify replace file data with minify of them if possible.

func (*File) ParentDirectory

func (f *File) ParentDirectory() protocol.FileDirectory

func (*File) Prepend

func (f *File) Prepend(data []byte)

Prepend add given data to start of exiting data that add earlier

func (*File) ReadFrom

func (f *File) ReadFrom(reader io.Reader) (n int64, err error)

ReadFrom decodes f *File data by read from given io.Reader!

func (*File) Rename

func (f *File) Rename(newName string)

Rename rename file name and full name

func (*File) Replace

func (f *File) Replace(old, new []byte, n int)

Replace replace all old data in the file with new one

func (*File) ReplaceLocation

func (f *File) ReplaceLocation(data []ReplaceReq)

Replace replace given data in the file

func (*File) Save

func (f *File) Save() (err protocol.Error)

Save use to write file to the file system!

func (*File) Unmarshal

func (f *File) Unmarshal(data []byte) (err protocol.Error)

Unmarshal save given data to the file. It will overwritten exiting data.

func (*File) WriteTo

func (f *File) WriteTo(w io.Writer) (totalWrite int64, err error)

WriteTo enecodes f *File data and write it to given io.Writer! Declare to respect io.WriterTo interface!

type FileDirectory

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

FileDirectory use to store app needed data from repo like html, css, js, ...

func (*FileDirectory) Copy

func (dir *FileDirectory) Copy(uriPath, newURIPath string) (err protocol.Error)

func (*FileDirectory) Delete

func (dir *FileDirectory) Delete(uriPath string) (err protocol.Error)

func (*FileDirectory) Directories

func (dir *FileDirectory) Directories(offset, limit uint64) (dirs []protocol.FileDirectory)

Mkdir make new directory in relative path from given directory.

func (*FileDirectory) Directory

func (dir *FileDirectory) Directory(name string) (dr protocol.FileDirectory, err protocol.Error)

Directory return the directory by its name or make new one if desire name not exist.

func (*FileDirectory) DirectoryByPath

func (dir *FileDirectory) DirectoryByPath(pathParts []string) (directory protocol.FileDirectory, err protocol.Error)

DirectoryByPath use to get a directory by its full path location. path is the file location in FileSystems include file name

func (*FileDirectory) File

func (dir *FileDirectory) File(name string) (file protocol.File, err protocol.Error)

File use to get a file by its full name with extension And make new one if desire name not exist.

func (*FileDirectory) FileByPath

func (dir *FileDirectory) FileByPath(uriPath string) (file protocol.File, err protocol.Error)

FileByPath use to get a file by its path in the directory

func (*FileDirectory) Files

func (dir *FileDirectory) Files(offset, limit uint64) (files []protocol.File)

Files use to get all files in order by name.

func (*FileDirectory) FindFile

func (dir *FileDirectory) FindFile(partName string) (files protocol.File)

FindFiles use to get a file by some part of its name!

func (*FileDirectory) FindFileRecursively

func (dir *FileDirectory) FindFileRecursively(partName string) (file *File)

FindFileRecursively use to get a file by its ful name with extension in recursively!

func (*FileDirectory) FindFiles

func (dir *FileDirectory) FindFiles(partName string, num uint) (files []protocol.File)

FindFiles use to get a file by some part of its name!

func (*FileDirectory) GetDependencyRecursively

func (dir *FileDirectory) GetDependencyRecursively(name string) *FileDirectory

GetDependencyRecursively use to get a dependency by its name in recursively!

func (*FileDirectory) MetaData

func (*FileDirectory) Move

func (dir *FileDirectory) Move(uriPath, newURIPath string) (err protocol.Error)

func (*FileDirectory) ParentDirectory

func (dir *FileDirectory) ParentDirectory() protocol.FileDirectory

func (*FileDirectory) Rename

func (dir *FileDirectory) Rename(oldURIPath, newURIPath string) (err protocol.Error)

func (*FileDirectory) Wipe

func (dir *FileDirectory) Wipe(uriPath string) (err protocol.Error)

type ReplaceReq

type ReplaceReq struct {
	Data  string
	Start int
	End   int
}

ReplaceReq is request structure of Replace method.

Jump to

Keyboard shortcuts

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