Documentation
¶
Overview ¶
* @Author: LinkLeong link@icewhale.org * @Date: 2022-07-27 10:30:43 * @LastEditors: LinkLeong * @LastEditTime: 2022-08-04 20:06:04 * @FilePath: /CasaOS/model/connections.go * @Description: * @Website: https://www.casaos.io * Copyright (c) 2022 by icewhale, All Rights Reserved.
* @Author: LinkLeong link@icewhale.com * @Date: 2022-05-20 16:27:12 * @LastEditors: LinkLeong * @LastEditTime: 2022-06-09 18:18:46 * @FilePath: /CasaOS/model/file.go * @Description: * @Website: https://www.casaos.io * Copyright (c) 2022 by icewhale, All Rights Reserved.
* @Author: LinkLeong link@icewhale.org * @Date: 2022-07-26 11:12:12 * @LastEditors: LinkLeong * @LastEditTime: 2022-07-27 14:58:55 * @FilePath: /CasaOS/model/share.go * @Description: * @Website: https://www.casaos.io * Copyright (c) 2022 by icewhale, All Rights Reserved.
* @Author: LinkLeong link@icewhale.com * @Date: 2022-05-13 18:15:46 * @LastEditors: LinkLeong * @LastEditTime: 2022-09-02 22:12:34 * @FilePath: /CasaOS/model/sys_common.go * @Description: * @Website: https://www.casaos.io * Copyright (c) 2022 by icewhale, All Rights Reserved.
* @Author: LinkLeong link@icewhale.org * @Date: 2022-05-13 18:15:46 * @LastEditors: LinkLeong * @LastEditTime: 2022-08-01 18:32:57 * @FilePath: /CasaOS/model/zima.go * @Description: * @Website: https://www.casaos.io * Copyright (c) 2022 by icewhale, All Rights Reserved.
Index ¶
- Constants
- func ExtractFolder(objs []Obj, extractFolder string)
- func GetThumb(obj Obj) (thumb string, ok bool)
- func GetUrl(obj Obj) (url string, ok bool)
- func SortFiles(objs []Obj, orderBy, orderDirection string)
- func WrapObjsName(objs []Obj)
- type APPModel
- type BaseInfo
- type CasaOSHeart
- type CommonModel
- type Connections
- type DeviceInfo
- type Drive
- type FileItem
- type FileOperate
- type FileSetting
- type FileStream
- type FileStreamer
- type FileUpdate
- type FsOtherArgs
- type GoDaddyModel
- type IOCountersStat
- type Link
- type LinkArgs
- type ListArgs
- type NotifyMssage
- type Obj
- type ObjMerge
- type ObjThumb
- type ObjThumbURL
- type ObjWrapName
- type Object
- type ObjectURL
- type OtherArgs
- type PageReq
- type PageResp
- type Path
- type Proxy
- type RedisModel
- type Result
- type SambaUser
- type SearchEngine
- type ServerModel
- type SetPath
- type SettingItem
- type Shares
- type Sort
- type StorageA
- type SysInfoModel
- type SystemConfig
- type Thumb
- type Thumbnail
- type URL
- type UnwrapObj
- type Url
- type UserInfo
- type Version
Constants ¶
const ( SINGLE = iota SITE STYLE PREVIEW GLOBAL ARIA2 INDEX GITHUB )
const ( PUBLIC = iota PRIVATE READONLY DEPRECATED )
const MaxInt = int(MaxUint >> 1)
const MaxUint = ^uint(0)
const MinInt = -MaxInt - 1
const MinUint = 0
Variables ¶
This section is empty.
Functions ¶
func ExtractFolder ¶
func WrapObjsName ¶
func WrapObjsName(objs []Obj)
Types ¶
type APPModel ¶
type APPModel struct {
LogPath string
LogSaveName string
LogFileExt string
DateStrFormat string
DateTimeFormat string
UserDataPath string
TimeFormat string
DateFormat string
DBPath string
ShellPath string
}
服务配置
type CasaOSHeart ¶
type CommonModel ¶
type CommonModel struct {
RuntimePath string
}
type Connections ¶
type DeviceInfo ¶
type DeviceInfo struct {
LanIpv4 []string `json:"lan_ipv4"`
Port int `json:"port"`
DeviceName string `json:"device_name"`
DeviceModel string `json:"device_model"`
DeviceSN string `json:"device_sn"`
Initialized bool `json:"initialized"`
OS_Version string `json:"os_version"`
Hash string `json:"hash"`
}
type FileOperate ¶
type FileOperate struct {
Type string `json:"type" binding:"required"`
Item []FileItem `json:"item" binding:"required"`
TotalSize int64 `json:"total_size"`
ProcessedSize int64 `json:"processed_size"`
To string `json:"to" binding:"required"`
Style string `json:"style"`
Finished bool `json:"finished"`
}
type FileSetting ¶
type FileSetting struct {
DownloadDir string `json:"download_dir"`
}
type FileStream ¶
func (*FileStream) GetMimetype ¶
func (f *FileStream) GetMimetype() string
func (*FileStream) GetOld ¶
func (f *FileStream) GetOld() Obj
func (*FileStream) GetReadCloser ¶
func (f *FileStream) GetReadCloser() io.ReadCloser
func (*FileStream) NeedStore ¶
func (f *FileStream) NeedStore() bool
func (*FileStream) SetReadCloser ¶
func (f *FileStream) SetReadCloser(rc io.ReadCloser)
type FileStreamer ¶
type FileStreamer interface {
io.ReadCloser
Obj
GetMimetype() string
SetReadCloser(io.ReadCloser)
NeedStore() bool
GetReadCloser() io.ReadCloser
GetOld() Obj
}
type FileUpdate ¶
type FsOtherArgs ¶
type GoDaddyModel ¶
type IOCountersStat ¶
type IOCountersStat struct {
Name string `json:"name"` // interface name
BytesSent uint64 `json:"bytesSent"` // number of bytes sent
BytesRecv uint64 `json:"bytesRecv"` // number of bytes received
PacketsSent uint64 `json:"packetsSent"` // number of packets sent
PacketsRecv uint64 `json:"packetsRecv"` // number of packets received
Errin uint64 `json:"errin"` // total number of errors while receiving
Errout uint64 `json:"errout"` // total number of errors while sending
Dropin uint64 `json:"dropin"` // total number of incoming packets which were dropped
Dropout uint64 `json:"dropout"` // total number of outgoing packets which were dropped (always 0 on OSX and BSD)
Fifoin uint64 `json:"fifoin"` // total number of FIFO buffers errors while receiving
Fifoout uint64 `json:"fifoout"` // total number of FIFO buffers errors while sending
State string `json:"state"`
Time int64 `json:"time"`
}
func IOCountersFrom ¶ added in v0.4.55
func IOCountersFrom(counters net.IOCountersStat) IOCountersStat
IOCountersFrom copies what gopsutil counted for one interface. It used to be a reinterpretation through unsafe.Pointer, which read this struct's length out of gopsutil's shorter one: the 24 bytes past its end landed in State and Time, so State held whatever pointer sat there until the caller overwrote it, and the garbage collector could find it first.
type Link ¶
type Link struct {
URL string `json:"url"`
Header http.Header `json:"header"` // needed header
Data io.ReadCloser // return file reader directly
Status int // status maybe 200 or 206, etc
FilePath *string // local file, return the filepath
Expiration *time.Duration // url expiration time
Method string `json:"method"` // http method
}
type NotifyMssage ¶
type Obj ¶
type Obj interface {
GetSize() int64
GetName() string
ModTime() time.Time
IsDir() bool
// The internal information of the driver.
// If you want to use it, please understand what it means
GetID() string
GetPath() string
}
func UnwrapObjs ¶
type ObjMerge ¶
type ObjMerge struct {
// contains filtered or unexported fields
}
func (*ObjMerge) InitHideReg ¶
type ObjThumbURL ¶
type ObjWrapName ¶
func (*ObjWrapName) GetName ¶
func (o *ObjWrapName) GetName() string
func (*ObjWrapName) Unwrap ¶
func (o *ObjWrapName) Unwrap() Obj
type Object ¶
type PageResp ¶
type PageResp struct {
Content interface{} `json:"content"`
Total int64 `json:"total"`
}
type Path ¶
type Path struct {
Name string `json:"name"` //File name or document name
Path string `json:"path"` //Full path to file or folder
IsDir bool `json:"is_dir"` //Is it a folder
Date time.Time `json:"date"`
Size int64 `json:"size"` //File Size
Type string `json:"type,omitempty"`
Label string `json:"label,omitempty"`
Write bool `json:"write"`
Extensions map[string]interface{} `json:"extensions"`
}
type Proxy ¶
type Proxy struct {
WebProxy bool `json:"web_proxy"`
WebdavPolicy string `json:"webdav_policy"`
DownProxyUrl string `json:"down_proxy_url"`
}
func (Proxy) WebdavNative ¶
func (Proxy) WebdavProxy ¶
type RedisModel ¶
type RedisModel struct {
Host string
Password string
MaxIdle int
MaxActive int
IdleTimeout time.Duration
}
redis配置文件
type Result ¶
type Result struct {
Success int `json:"success" example:"200"`
Message string `json:"message" example:"ok"`
Data interface{} `json:"data" example:"返回结果"`
}
公共返回模型
type SambaUser ¶
SambaUser is the payload for creating a share account or changing its password. It is never returned to a client: the password field only ever travels inwards.
type SearchEngine ¶
type ServerModel ¶
type ServerModel struct {
HttpPort string
RunMode string
LockAccount bool
Token string
USBAutoMount string
UpdateUrl string
UpdateVersionUrl string
}
服务配置
type SettingItem ¶
type SettingItem struct {
Key string `json:"key" gorm:"primaryKey" binding:"required"` // unique key
Value string `json:"value"` // value
Help string `json:"help"` // help message
Type string `json:"type"` // string, number, bool, select
Options string `json:"options"` // values for select
Group int `json:"group"` // use to group setting in frontend
Flag int `json:"flag"` // 0 = public, 1 = private, 2 = readonly, 3 = deprecated, etc.
}
func (SettingItem) IsDeprecated ¶
func (s SettingItem) IsDeprecated() bool
type StorageA ¶
type StorageA struct {
ID uint `json:"id" gorm:"primaryKey"` // unique key
MountPath string `json:"mount_path" gorm:"unique" binding:"required"` // must be standardized
Order int `json:"order"` // use to sort
Driver string `json:"driver"` // driver used
CacheExpiration int `json:"cache_expiration"` // cache expire time
Status string `json:"status"`
Addition string `json:"addition" gorm:"type:text"` // Additional information, defined in the corresponding driver
Remark string `json:"remark"`
Modified time.Time `json:"modified"`
Disabled bool `json:"disabled"` // if disabled
Sort
Proxy
}
func (*StorageA) GetStorage ¶
func (*StorageA) SetStorage ¶
type SystemConfig ¶
type SystemConfig struct {
ConfigPath string `json:"config_path"`
}
type Version ¶
type Version struct {
Id uint `gorm:"column:id;primary_key" json:"id"`
ChangeLog string `json:"change_log"`
Version string `json:"version"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
// PublishedAt is when the release was built (RFC 3339), which the automatic
// update waits 48 hours after. A string: a value that is not a time leaves
// the release to the button and never makes the whole version.json unreadable.
PublishedAt string `json:"published_at,omitempty"`
}
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
* @Author: LinkLeong link@icewhale.com * @Date: 2022-05-26 14:21:57 * @LastEditors: LinkLeong * @LastEditTime: 2022-06-02 11:14:15 * @FilePath: /CasaOS/model/notify/file.go * @Description: * @Website: https://www.casaos.io * Copyright (c) 2022 by icewhale, All Rights Reserved.
|
* @Author: LinkLeong link@icewhale.com * @Date: 2022-05-26 14:21:57 * @LastEditors: LinkLeong * @LastEditTime: 2022-06-02 11:14:15 * @FilePath: /CasaOS/model/notify/file.go * @Description: * @Website: https://www.casaos.io * Copyright (c) 2022 by icewhale, All Rights Reserved. |
|
* @Author: LinkLeong link@icewhale.com * @Date: 2022-06-15 11:30:47 * @LastEditors: LinkLeong * @LastEditTime: 2022-06-23 18:40:40 * @FilePath: /CasaOS/model/system_model/verify_information.go * @Description: * @Website: https://www.casaos.io * Copyright (c) 2022 by icewhale, All Rights Reserved.
|
* @Author: LinkLeong link@icewhale.com * @Date: 2022-06-15 11:30:47 * @LastEditors: LinkLeong * @LastEditTime: 2022-06-23 18:40:40 * @FilePath: /CasaOS/model/system_model/verify_information.go * @Description: * @Website: https://www.casaos.io * Copyright (c) 2022 by icewhale, All Rights Reserved. |