fs

package
v0.14.3 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeFormat = "2006-01-02 15:04:05"
)

Variables

This section is empty.

Functions

func CleanMountPodController added in v0.14.3

func CleanMountPodController(mountPodExpire, cleanMountPodIntervalTime time.Duration,
	stopChan chan struct{})

func CreateFileSystemCacheConfig

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

func DeleteFileSystemCacheConfig

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

func ReportCache

func ReportCache(ctx *logger.RequestContext, req CacheReportRequest) error

func UpdateFileSystemCacheConfig

func UpdateFileSystemCacheConfig(ctx *logger.RequestContext, req UpdateFileSystemCacheRequest) error

Types

type CacheReportRequest

type CacheReportRequest struct {
	FsName    string `json:"fsName" validate:"required"`
	Username  string `json:"username"`
	ClusterID string `json:"clusterID"`
	CacheDir  string `json:"cacheDir" validate:"required"`
	NodeName  string `json:"nodename" validate:"required"`
	UsedSize  int    `json:"usedsize" validate:"required"`
}

type CreateFileSystemCacheRequest

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

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"`
	NodeAffinity        map[string]interface{} `json:"nodeAffinity"`
	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) CheckFsMountedAndCleanResources added in v0.14.3

func (s *FileSystemService) CheckFsMountedAndCleanResources(fsID string) (bool, error)

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

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 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"`
}

type UpdateFileSystemCacheRequest

type UpdateFileSystemCacheRequest struct {
	FsID                string                 `json:"-"`
	CacheDir            string                 `json:"cacheDir"`
	Quota               int                    `json:"quota"`
	MetaDriver          string                 `json:"metaDriver"`
	BlockSize           int                    `json:"blockSize"`
	Debug               bool                   `json:"debug"`
	NodeAffinity        map[string]interface{} `json:"nodeAffinity"`
	NodeTaintToleration map[string]interface{} `json:"nodeTaintToleration"`
	ExtraConfig         map[string]string      `json:"extraConfig"`
}

Jump to

Keyboard shortcuts

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