api

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: 9 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.
*

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPermissionsName

func GetPermissionsName(permissions model.Permissions) string

func WriteJSON

func WriteJSON(w http.ResponseWriter, v interface{}, code ...int)

Types

type Bot

type Bot interface {
	BotCreateDM(message string, userID string)
	BotCreatePost(message string, channelID string)
	BotCreateReply(message string, channelID string, parentID string)
}

type Encoder

type Encoder interface {
	Encode(text string) (string, error)
}

type JwtManager

type JwtManager interface {
	Sign(payload jwt.Claims) (string, error)
	Verify(jwt string, body interface{}) error
	GetKey() []byte
}

type OnlyofficeCovnerter

type OnlyofficeCovnerter interface {
	GetTimestamp() int64
	GetTime(timestamp int64) time.Time
}

type OnlyofficeHelper

type OnlyofficeHelper interface {
	IsExtensionSupported(fileExt string) bool
	IsExtensionEditable(fileExt string) bool
	GetFileType(fileExt string) (string, error)
	GenerateKey() string
	GetPostPermissionsByFileID(fileID string, post *mmModel.Post, getUser func(string) (*mmModel.User, *mmModel.AppError)) []model.UserInfoResponse
	GetFilePermissionsByUserID(userID string, fileID string, post *mmModel.Post) model.Permissions
	UserHasFilePermissions(userID string, fileID string, post *mmModel.Post) bool
	SetPostFilePermissions(post *mmModel.Post, permissions []model.PostPermission) []model.PostPermission
	GetWildcardUser() string
}

type PluginAPI

type PluginAPI struct {
	API           plugin.API
	Configuration struct {
		Address      string
		Secret       string
		Header       string
		Prefix       string
		MMAuthHeader string
	}
	OnlyofficeHelper    OnlyofficeHelper
	OnlyofficeConverter OnlyofficeCovnerter
	Encoder             Encoder
	Manager             JwtManager
	Bot                 Bot
	EditorTemplate      *template.Template
	Filestore           filestore.FileBackend
}

Directories

Path Synopsis
onlyoffice
*
model
*
*
*
*
web
*
*
*

Jump to

Keyboard shortcuts

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