fs

package
v0.14.6 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxMountPodCpuLimit = "2"
	MaxMountPodMemLimit = "8Gi"
)
View Source
const (
	TimeFormat = "2006-01-02 15:04:05"
)

Variables

This section is empty.

Functions

func CreateFileSystemCacheConfig

func CreateFileSystemCacheConfig(ctx *logger.RequestContext, req CreateFileSystemCacheRequest) error

func DeleteFileSystemCacheConfig

func DeleteFileSystemCacheConfig(ctx *logger.RequestContext, fsID string) error

func MountPodController added in v0.14.5

func MountPodController(mountPodExpire, interval time.Duration,
	stopChan chan struct{})

Types

type CreateFileSystemCacheRequest

type CreateFileSystemCacheRequest struct {
	Username            string                 `json:"username"`
	FsName              string                 `json:"fsName"`
	FsID                string                 `json:"-"`
	CacheDir            string                 `json:"cacheDir"`
	Quota               int                    `json:"quota"`
	MetaDriver          string                 `json:"metaDriver"`
	BlockSize           int                    `json:"blockSize"`
	Debug               bool                   `json:"debug"`
	CleanCache          bool                   `json:"cleanCache"`
	Resource            model.ResourceLimit    `json:"resource"`
	NodeTaintToleration map[string]interface{} `json:"nodeTaintToleration"`
	ExtraConfig         map[string]string      `json:"extraConfig"`
}

type CreateFileSystemClaimsResponse

type CreateFileSystemClaimsResponse struct {
	Message string `json:"message"`
}

type CreateFileSystemRequest

type CreateFileSystemRequest struct {
	Name                    string            `json:"name"`
	Url                     string            `json:"url"`
	Properties              map[string]string `json:"properties"`
	Username                string            `json:"username"`
	IndependentMountProcess bool              `json:"independentMountProcess"`
}

type CreateFileSystemResponse

type CreateFileSystemResponse struct {
	FsName string `json:"fsName"`
	FsID   string `json:"fsID"`
}

type CreateLinkRequest

type CreateLinkRequest struct {
	FsName     string            `json:"fsName"`
	Url        string            `json:"url"`
	Properties map[string]string `json:"properties"`
	Username   string            `json:"username"`
	FsPath     string            `json:"fsPath"`
}

type DeleteFileSystemRequest

type DeleteFileSystemRequest struct {
	FsName   string `json:"fsName"`
	Username string `json:"username"`
}

type DeleteLinkRequest

type DeleteLinkRequest struct {
	FsName   string `json:"fsName"`
	Username string `json:"username"`
	FsPath   string `json:"fsPath"`
}

type FileSystemCacheResponse

type FileSystemCacheResponse struct {
	CacheDir            string                 `json:"cacheDir"`
	Quota               int                    `json:"quota"`
	MetaDriver          string                 `json:"metaDriver"`
	BlockSize           int                    `json:"blockSize"`
	CleanCache          bool                   `json:"cleanCache"`
	Resource            model.ResourceLimit    `json:"resource"`
	NodeTaintToleration map[string]interface{} `json:"nodeTaintToleration"`
	ExtraConfig         map[string]string      `json:"extraConfig"`
	FsName              string                 `json:"fsName"`
	Username            string                 `json:"username"`
	CreateTime          string                 `json:"createTime"`
	UpdateTime          string                 `json:"updateTime,omitempty"`
}

func GetFileSystemCacheConfig

func GetFileSystemCacheConfig(ctx *logger.RequestContext, fsID string) (FileSystemCacheResponse, error)

type FileSystemResponse

type FileSystemResponse struct {
	Id                      string            `json:"id"`
	Name                    string            `json:"name"`
	ServerAddress           string            `json:"serverAddress"`
	Type                    string            `json:"type"`
	SubPath                 string            `json:"subPath"`
	Username                string            `json:"username"`
	Properties              map[string]string `json:"properties"`
	IndependentMountProcess bool              `json:"independentMountProcess"`
}

type FileSystemService

type FileSystemService struct{}

FileSystemService the service which contains the operation of file system

func GetFileSystemService

func GetFileSystemService() *FileSystemService

GetFileSystemService returns the instance of file system service

func (*FileSystemService) CreateFileSystem

CreateFileSystem the function which performs the operation of creating FileSystem

func (*FileSystemService) DeleteFileSystem

func (s *FileSystemService) DeleteFileSystem(ctx *logger.RequestContext, fsID string) error

DeleteFileSystem the function which performs the operation of delete file system

func (*FileSystemService) GetFileSystem

func (s *FileSystemService) GetFileSystem(username, fsName string) (model.FileSystem, error)

GetFileSystem the function which performs the operation of getting file system detail

func (*FileSystemService) HasFsPermission added in v0.14.3

func (s *FileSystemService) HasFsPermission(username, fsID string) (bool, error)

func (*FileSystemService) ListFileSystem

ListFileSystem the function which performs the operation of list file systems

func (*FileSystemService) SessionToken added in v0.14.6

func (s *FileSystemService) SessionToken(username, fsName string) (*GetStsResponse, error)

SessionToken get sts token from bos

type GetFileSystemRequest

type GetFileSystemRequest struct {
	FsName   string `json:"fsName"`
	Username string `json:"username"`
}

type GetFileSystemResponse

type GetFileSystemResponse struct {
	Id            string            `json:"id"`
	Name          string            `json:"name"`
	ServerAddress string            `json:"serverAddress"`
	Type          string            `json:"type"`
	SubPath       string            `json:"subPath"`
	Username      string            `json:"username"`
	Properties    map[string]string `json:"properties"`
}

type GetLinkRequest

type GetLinkRequest struct {
	Marker  string `json:"marker"`
	MaxKeys int32  `json:"maxKeys"`
	FsID    string `json:"fsID"`
	FsPath  string `json:"fsPath"`
}

type GetLinkResponse

type GetLinkResponse struct {
	Marker     string          `json:"marker"`
	Truncated  bool            `json:"truncated"`
	NextMarker string          `json:"nextMarker"`
	LinkList   []*LinkResponse `json:"linkList"`
}

type GetSessionRequest added in v0.14.6

type GetSessionRequest struct {
	FsName   string `json:"fsName"`
	Username string `json:"username"`
}

type GetStsResponse added in v0.14.6

type GetStsResponse struct {
	AccessKeyId     string `json:"accessKey"`
	SecretAccessKey string `json:"secretKey"`
	SessionToken    string `json:"sessionToken"`
	CreateTime      string `json:"createTime"`
	Expiration      string `json:"expiration"`
	UserId          string `json:"userId"`
	Bucket          string `json:"bucket"`
	SubPath         string `json:"subPath"`
	Endpoint        string `json:"endpoint"`
	Region          string `json:"region"`
	Duration        int    `json:"duration"`
}

type LinkResponse

type LinkResponse struct {
	FsName        string            `json:"fsName"`
	FsPath        string            `json:"fsPath"`
	ServerAddress string            `json:"serverAddress"`
	Type          string            `json:"type"`
	Username      string            `json:"username"`
	SubPath       string            `json:"subPath"`
	Properties    map[string]string `json:"properties"`
}

type LinkService

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

LinkService the service which contains the operation of link

func GetLinkService

func GetLinkService() *LinkService

GetLinkService returns the instance of link service

func (s *LinkService) CreateLink(ctx *logger.RequestContext, req *CreateLinkRequest) (model.Link, error)

CreateLink the function which performs the operation of creating Link

func (s *LinkService) DeleteLink(ctx *logger.RequestContext, req *DeleteLinkRequest) error

DeleteLink the function which performs the operation of delete file system link

func (*LinkService) FsLock

func (s *LinkService) FsLock(fsID string) func()

todo 考虑多server并发控制

func (s *LinkService) GetLink(req *GetLinkRequest) ([]model.Link, string, error)

GetLink the function which performs the operation of list file system links

func (*LinkService) PersistLinksMeta

func (s *LinkService) PersistLinksMeta(fsID string) error

type ListFileSystemRequest

type ListFileSystemRequest struct {
	Marker   string `json:"marker"`
	MaxKeys  int32  `json:"maxKeys"`
	Username string `json:"username"`
	FsName   string `json:"fsName"`
}

type ListFileSystemResponse

type ListFileSystemResponse struct {
	Marker     string                `json:"marker"`
	Truncated  bool                  `json:"truncated"`
	NextMarker string                `json:"nextMarker"`
	FsList     []*FileSystemResponse `json:"fsList"`
}

Jump to

Keyboard shortcuts

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