model

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

*

*
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*

*

*
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*

*

*
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*

Index

Constants

This section is empty.

Variables

View Source
var (
	OnlyofficeAuthorPermissions = Permissions{
		Comment:  true,
		Copy:     true,
		Download: true,
		Edit:     true,
		Print:    true,
		Review:   true,
	}
	OnlyofficeDefaultPermissions = Permissions{
		Edit: false,
	}
)

Functions

This section is empty.

Types

type Callback

type Callback struct {
	Actions []struct {
		Type   int    `json:"type"`
		UserID string `json:"userid"`
	} `json:"actions"`
	Key    string   `json:"key" validate:"required"`
	Status int      `json:"status" validate:"required"`
	Users  []string `json:"users"`
	URL    string   `json:"url"`
	FileID string   `json:"-" validate:"required"`
	Token  string   `json:"token"`
}

func (*Callback) Validate

func (c *Callback) Validate() error

type CallbackResponse

type CallbackResponse struct {
	Error int8 `json:"error"`
}

type Config

type Config struct {
	jwt.RegisteredClaims
	Document     Document     `json:"document"`
	DocumentType string       `json:"documentType"`
	EditorConfig EditorConfig `json:"editorConfig"`
	Type         string       `json:"type"`
	Token        string       `json:"token,omitempty"`
}

type Customization

type Customization struct {
	Goback Goback `json:"goback"`
}

type Document

type Document struct {
	FileType    string      `json:"fileType"`
	Key         string      `json:"key"`
	Title       string      `json:"title"`
	URL         string      `json:"url"`
	Permissions Permissions `json:"permissions"`
}

type DownloadToken

type DownloadToken struct {
	Payload DownloadTokenPayload `json:"payload"`
	jwt.RegisteredClaims
}

type DownloadTokenPayload added in v1.1.3

type DownloadTokenPayload struct {
	URL string `json:"url"`
}

type EditorConfig

type EditorConfig struct {
	User          User          `json:"user"`
	CallbackURL   string        `json:"callbackUrl"`
	Customization Customization `json:"customization,omitempty"`
	Lang          string        `json:"lang,omitempty"`
}

type Goback

type Goback struct {
	RequestClose bool `json:"requestClose"`
}

type Permissions

type Permissions struct {
	Comment                 bool `json:"comment,omitempty"`
	Copy                    bool `json:"copy,omitempty"`
	DeleteCommentAuthorOnly bool `json:"deleteCommentAuthorOnly,omitempty"`
	Download                bool `json:"download,omitempty"`
	Edit                    bool `json:"edit"`
	EditCommentAuthorOnly   bool `json:"editCommentAuthorOnly,omitempty"`
	FillForms               bool `json:"fillForms,omitempty"`
	ModifyContentControl    bool `json:"modifyContentControl,omitempty"`
	ModifyFilter            bool `json:"modifyFilter,omitempty"`
	Print                   bool `json:"print,omitempty"`
	Review                  bool `json:"review,omitempty"`
}

type PostPermission

type PostPermission struct {
	FileID      string      `json:"fileID"`
	UserID      string      `json:"userID"`
	Username    string      `json:"username"`
	Permissions Permissions `json:"permissions"`
}

type User

type User struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type UserInfoResponse

type UserInfoResponse struct {
	ID          string      `json:"id"`
	Username    string      `json:"username"`
	Permissions Permissions `json:"permissions"`
	Email       string      `json:"email"`
}

Jump to

Keyboard shortcuts

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