Documentation ¶
Index ¶
- Constants
- func AssertValid(verify types.Verification, data []byte) error
- func CreateDeviceAlias(path string) (string, error)
- func DeviceAlias(path string) string
- func FilesystemLabel(device string) (string, error)
- func FilesystemType(device string) (string, error)
- func FilesystemUUID(device string) (string, error)
- func GetHasher(verify types.Verification) (hash.Hash, error)
- func MkdirForFile(path string) error
- func NetworkdUnitsPath() string
- func SystemdDropinsPath(unitName string) string
- func SystemdUnitsPath() string
- type ErrHashMismatch
- type File
- type Util
- func (u Util) AuthorizeSSHKeys(c types.PasswdUser) error
- func (u Util) CheckIfUserExists(c types.PasswdUser) (bool, error)
- func (u Util) CreateGroup(g types.PasswdGroup) error
- func (u Util) EnableUnit(unit types.Unit) error
- func (u Util) EnsureUser(c types.PasswdUser) error
- func (u Util) JoinPath(path ...string) string
- func (u Util) MaskUnit(unit types.Unit) error
- func (u Util) SetPasswordHash(c types.PasswdUser) error
- func (u Util) WriteFile(f *File) error
- func (u Util) WriteLink(s types.Link) error
Constants ¶
const ( DefaultDirectoryPermissions os.FileMode = 0755 DefaultFilePermissions os.FileMode = 0644 )
const (
DefaultPresetPermissions os.FileMode = 0644
)
Variables ¶
This section is empty.
Functions ¶
func AssertValid ¶ added in v0.10.1
func AssertValid(verify types.Verification, data []byte) error
func CreateDeviceAlias ¶ added in v0.10.1
CreateDeviceAlias creates a device alias for the supplied path. On success the canonicalized path used as the alias target is returned.
func DeviceAlias ¶ added in v0.10.1
DeviceAlias returns the aliased form of the supplied path. Note device paths in ignition are always absolute.
func FilesystemLabel ¶ added in v0.15.0
func FilesystemType ¶ added in v0.15.0
func FilesystemUUID ¶ added in v0.15.0
func MkdirForFile ¶ added in v0.13.0
MkdirForFile helper creates the directory components of path.
func NetworkdUnitsPath ¶
func NetworkdUnitsPath() string
func SystemdDropinsPath ¶
func SystemdUnitsPath ¶
func SystemdUnitsPath() string
Types ¶
type ErrHashMismatch ¶ added in v0.10.1
func (ErrHashMismatch) Error ¶ added in v0.10.1
func (e ErrHashMismatch) Error() string
type File ¶
type File struct { io.ReadCloser hash.Hash Path string Mode os.FileMode Uid int Gid int // contains filtered or unexported fields }
func FileFromNetworkdUnit ¶
func FileFromNetworkdUnit(unit types.Networkdunit) *File
func FileFromSystemdUnit ¶
func RenderFile ¶
RenderFile returns a *File with a Reader that downloads, hashes, and decompresses the incoming data. It returns nil if f had invalid options. Errors reading/verifying/decompressing the file will present themselves when the Reader is actually read from.
type Util ¶
Util encapsulates logging and destdir indirection for the util methods.
func (Util) AuthorizeSSHKeys ¶
func (u Util) AuthorizeSSHKeys(c types.PasswdUser) error
Add the provided SSH public keys to the user's authorized keys.
func (Util) CheckIfUserExists ¶ added in v0.15.0
func (u Util) CheckIfUserExists(c types.PasswdUser) (bool, error)
func (Util) CreateGroup ¶
func (u Util) CreateGroup(g types.PasswdGroup) error
CreateGroup creates the group as described.
func (Util) EnsureUser ¶ added in v0.15.0
func (u Util) EnsureUser(c types.PasswdUser) error
EnsureUser ensures that the user exists as described. If the user does not yet exist, they will be created, otherwise the existing user will be modified.
func (Util) SetPasswordHash ¶
func (u Util) SetPasswordHash(c types.PasswdUser) error
SetPasswordHash sets the password hash of the specified user.