Versions in this module Expand all Collapse all v1 v1.0.4 Jan 11, 2025 v1.0.3 Aug 3, 2024 Changes in this version + type UserContext struct + func (uc *UserContext) AppID() string + func (uc *UserContext) Query() url.Values + func (uc *UserContext) RequestID() string + func (uc *UserContext) Token() string v1.0.2 Jul 24, 2024 Changes in this version + var ErrFileNameConflict = &Error + var ErrFileNotExists = &Error + var ErrFileVersionNotExists = &Error + var ErrInternalError = &Error + var ErrInvalidArguments = &Error + var ErrPermissionDenied = &Error + var ErrSpaceFull = &Error + var ErrUnauthorized = &Error + var ErrUserNotExists = &Error + var Referer = "https://solution.wps.cn" + func NewServer(config Config, e *gin.Engine) + type Code int + const OK + type Config struct + Prefix string + type Context interface + AppID func() string + Query func() url.Values + RequestID func() string + Token func() string + func ParseContext(req *http.Request) Context + type EditProvider interface + RenameFile func(ctx Context, fileID string, args *RenameFileArgs) error + UpdateFile func(ctx Context, fileID string, args *UpdateFilePhaseArgs) (*GetFileReply, error) + type Empty struct + type Error struct + func NewCustomError(message string) *Error + func NewError(code Code) *Error + func (err *Error) Code() Code + func (err *Error) Error() string + func (err *Error) Message() string + func (err *Error) StatusCode() int + func (err *Error) WithMessage(msg string) *Error + type GetFileDownloadReply struct + Headers map[string]string + URL string + type GetFilePermissionReply struct + Comment int + Copy int + Download int + History int + Print int + Read int + Rename int + SaveAs int + Update int + UserId string + type GetFileReply struct + CreateTime int64 + CreatorId string + ID string + ModifierId string + ModifyTime int64 + Name string + Size int64 + Version int32 + type GetWatermarkReply struct + FillStyle string + Font string + Horizontal int + Rotate float64 + Type int + Value string + Vertical int + type Logger interface + Error func(format string, args ...any) + Info func(format string, args ...any) + func DefaultLogger() Logger + type NotifyArgs struct + Content NotifyContent + FileId string + Type string + type NotifyContent struct + ConnectionId string + Format string + InitVersion int + LastModifierId string + Permission string + Print bool + Readonly bool + SessionId string + UploadedVersion int + UserId string + type NotifyProvider interface + OnNotify func(ctx Context, args *NotifyArgs) error + type PreviewProvider interface + GetFile func(ctx Context, fileID string) (*GetFileReply, error) + GetFileDownload func(ctx Context, fileID string) (*GetFileDownloadReply, error) + GetFilePermission func(ctx Context, fileID string) (*GetFilePermissionReply, error) + type RenameFileArgs struct + Name string + type Reply struct + Code Code + Data any + Message string + type Server struct + func (srv *Server) Handler() http.Handler + func (srv *Server) Router() gin.IRouter + func (srv *Server) Run(addr string) error + type UpdateFilePhaseArgs struct + Content io.Reader + IsManual bool + Name string + SHA1 string + Size int64 + type UserProvider interface + GetUsers func(ctx Context, userIDs []string) ([]*UserReply, error) + type UserReply struct + AvatarURL string + ID string + Name string + type VersionProvider interface + GetFileVersion func(ctx Context, fileID string, version int32) (*GetFileReply, error) + GetFileVersionDownload func(ctx Context, fileID string, version int32) (*GetFileDownloadReply, error) + GetFileVersions func(ctx Context, fileID string, offset, limit int) ([]*GetFileReply, error) + type WatermarkProvider interface + GetFileWatermark func(ctx Context, fileID string) (*GetWatermarkReply, error)