Documentation ¶
Index ¶
- Constants
- func CreateDest(dest string) error
- func GetDefaultAK() (string, string, string)
- func GetLocalAK() (string, string)
- func GetMetaData(resource string) (string, error)
- func GetRegionAndInstanceId() (string, string, error)
- func GetRegionIdAndInstanceId(nodeName string) (string, string, error)
- func GetSTSAK() (string, string, string)
- func IsDirEmpty(name string) (bool, error)
- func IsFileExisting(filename string) bool
- func IsMounted(mountPath string) bool
- func ReadJsonFile(file string) (map[string]string, error)
- func Run(cmd string) (string, error)
- func Umount(mountPath string) bool
- func WriteJosnFile(obj interface{}, file string) error
- type DefaultOptions
- type Mounter
- type Result
Constants ¶
View Source
const ( USER_AKID = "/etc/.volumeak/akId" USER_AKSECRET = "/etc/.volumeak/akSecret" METADATA_URL = "http://100.100.100.200/latest/meta-data/" REGIONID_TAG = "region-id" INSTANCEID_TAG = "instance-id" )
Variables ¶
This section is empty.
Functions ¶
func CreateDest ¶
func GetDefaultAK ¶
read default ak from local file or from STS
func GetRegionAndInstanceId ¶
Get regionid instanceid;
func IsDirEmpty ¶
Types ¶
type DefaultOptions ¶
type DefaultOptions struct { Global struct { KubernetesClusterTag string AccessKeyID string `json:"accessKeyID"` AccessKeySecret string `json:"accessKeySecret"` Region string `json:"region"` } }
used for global ak
type Mounter ¶
type Mounter interface { // If the folder doesn't exist, it will call 'mkdir -p' EnsureFolder(target string) error // If the block doesn't exist, create it EnsureBlock(target string) error // Format formats the source with the given filesystem type Format(source, fsType string) error // Mount mounts source to target with the given fstype and options. Mount(source, target, fsType string, options ...string) error // Mount mounts source to target for block file. MountBlock(source, target string, options ...string) error // Unmount unmounts the given target Unmount(target string) error // IsFormatted checks whether the source device is formatted or not. It // returns true if the source device is already formatted. IsFormatted(source string) (bool, error) // IsMounted checks whether the target path is a correct mount (i.e: // propagated). It returns true if it's mounted. An error is returned in // case of system errors or if it's mounted incorrectly. IsMounted(target string) (bool, error) SafePathRemove(target string) error HasMountRefs(mountPath string, mountRefs []string) bool }
Mounter is responsible for formatting and mounting volumes
Click to show internal directories.
Click to hide internal directories.