filemode

package
v0.44.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package filemode provides a wrapper around os.FileMode so that it can be parsed from a CLI flag.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidFilemode = errio.Namespace("filemode").Code("invalid_filemode").ErrorPref("%s is not a valid filemode: %v")
)

Errors

Functions

This section is empty.

Types

type FileMode

type FileMode os.FileMode

FileMode extends os.FileMode to implement the flag.Value interface, so that the file mode can be parsed from a flag.

func New

func New(fileMode os.FileMode) FileMode

New creates a new FileMode.

func Parse

func Parse(mode string) (FileMode, error)

Parse converts a string like 0644 to an os.FileMode.

func (FileMode) FileMode

func (m FileMode) FileMode() os.FileMode

FileMode returns the file mode as an os.FileMode.

func (*FileMode) Set

func (m *FileMode) Set(value string) error

Set implements the flag.Value interface.

func (FileMode) String

func (m FileMode) String() string

String implements the flag.Value interface.

func (*FileMode) Type added in v0.42.0

func (m *FileMode) Type() string

Jump to

Keyboard shortcuts

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