utils

package
v0.8.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	PageCurrent = "page"
	PageSize    = "pageSize"
)

Variables

View Source
var ReadBufPool = sync.Pool{
	New: func() interface{} {
		b := make([]byte, 1024)
		return &b
	},
}

ReadBufPool 读取缓冲池

Functions

func GetAIServiceURL added in v0.7.7

func GetAIServiceURL() string

func GetCoreServiceURL added in v0.7.7

func GetCoreServiceURL() string

func GetMilvusServiceURL added in v0.7.7

func GetMilvusServiceURL() string

func GetNatsServiceURL added in v0.7.7

func GetNatsServiceURL() string

func GetOSServiceURL added in v0.7.7

func GetOSServiceURL() string

Types

type IdentifierType added in v0.8.0

type IdentifierType interface {
	~int | ~int32 | ~int64 | ~uint | ~uint32 | uint64 | ~string
}

IdentifierType 定义identifier类型约束接口

type Pagination

type Pagination struct {
	Page     int `json:"page"`
	PageSize int `json:"pageSize"`
}

func NewPaginationFromIris

func NewPaginationFromIris(ctx iris.Context) *Pagination

type StorageType added in v0.8.0

type StorageType string
const (
	RawDisk     StorageType = "raw-disk"
	USB         StorageType = "usb"
	Baiduyun    StorageType = "baiduyun"
	CommonOSS   StorageType = "oss"
	AliyunOSS   StorageType = "aliyun-oss"
	TencentOSS  StorageType = "tencent-oss"
	SambaClient StorageType = "smb-client"
	UFSMeta     StorageType = "siyouyun-meta"
	UFSRaw      StorageType = "siyouyun-raw"
	UFSSandbox  StorageType = "siyouyun-sandbox"
	Snapshot    StorageType = "siyouyun-snapshot"
	Trash       StorageType = "siyouyun-trash"
	Webdav      StorageType = "webdav"
	FTP         StorageType = "ftp"
)

func (StorageType) IsSiyouyunStorage added in v0.8.0

func (t StorageType) IsSiyouyunStorage() bool

func (StorageType) String added in v0.8.0

func (t StorageType) String() string

type UFI added in v0.8.0

type UFI struct {
	StorageType StorageType `json:"storageType"`
	UUID        string      `json:"uuid"`
	Mode        UFIMode     `json:"mode"`       // 标识符类型: id path
	Identifier  string      `json:"identifier"` // 标识符正文
	// contains filtered or unexported fields
}

UFI 统一文件定位

func NewUFI added in v0.8.0

func NewUFI[T IdentifierType](storageType StorageType, uuid string, mode UFIMode, identifier T) *UFI

func (*UFI) Serialize added in v0.8.0

func (ufi *UFI) Serialize() string

Serialize siyouyun-pool的uuid需要同时传递UGN确定存储空间 usb的uuid是label的hash,不包含UGN信息,由权限管理控制访问 其余存储的uuid隐藏含义包含了UGN信息 eg:

  • 样板 /ufi/{storageType}/{uuid}/id/110 /ufi/{storageType}/{uuid}/path/123.png

func (*UFI) Validate added in v0.8.0

func (ufi *UFI) Validate() bool

type UFIMode added in v0.8.0

type UFIMode string

UFIMode ufi文件定位模式

const (
	IdUFI   UFIMode = "id"
	PathUFI UFIMode = "path"
)

func (UFIMode) String added in v0.8.0

func (U UFIMode) String() string

type UFIProtocol added in v0.8.0

type UFIProtocol string
const (
	UFIv1 UFIProtocol = "ufi"
)

func (UFIProtocol) String added in v0.8.0

func (U UFIProtocol) String() string

type UserGroupNamespace

type UserGroupNamespace struct {
	Username  string `json:"username"`  // 用户名
	GroupName string `json:"groupname"` // 组名
	Namespace string `json:"namespace"` // 命名空间
}

func NewUserGroupNamespace

func NewUserGroupNamespace(username, groupname, namespace string) *UserGroupNamespace

func NewUserNamespaceFromIris

func NewUserNamespaceFromIris(ctx iris.Context) *UserGroupNamespace

func (*UserGroupNamespace) DatabaseName

func (ugn *UserGroupNamespace) DatabaseName() string

func (*UserGroupNamespace) GetRealPrefix added in v0.5.4

func (ugn *UserGroupNamespace) GetRealPrefix(poolName string) string

func (*UserGroupNamespace) String

func (ugn *UserGroupNamespace) String() string

Jump to

Keyboard shortcuts

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