shared

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyResponse           = errors.New("got an empty response")
	ErrCouldNotCreatePublicURL = errors.New("could not generate a new public url")
	ErrCouldNotUploadFile      = errors.New("could not upload a new file version")
)

Functions

func BuildNewIntegrationCredentialsConfig

func BuildNewIntegrationCredentialsConfig(path string) func() (*oauth2.Config, error)

func BuildNewOnlyofficeConfig

func BuildNewOnlyofficeConfig(path string) func() (*OnlyofficeConfig, error)

Types

type BoxAPI

type BoxAPI interface {
	GetAuthCredentials(ctx context.Context, code, clientID, clientSecret string) (response.BoxCredentialsResponse, error)
	RefreshAuthCredentials(ctx context.Context, refreshToken, clientID, clientSecret string) (response.BoxCredentialsResponse, error)
	GetMe(ctx context.Context, token string) (response.BoxUserResponse, error)
	GetFileInfo(ctx context.Context, token, fileId string) (response.BoxFileResponse, error)
	GetFilePublicUrl(ctx context.Context, token, fileID string) (string, error)
	UploadFile(ctx context.Context, filename, token, parentID string, file io.ReadCloser) error
	CreateFile(ctx context.Context, filename, folderID, token string, file io.ReadCloser) (response.BoxCreateFileResponse, error)
	UpdateModifiedAt(ctx context.Context, token, fileID string) error
}

func NewBoxAPIClient

func NewBoxAPIClient() BoxAPI

type IntegrationCredentials

type IntegrationCredentials struct {
	Credentials struct {
		ClientID     string   `yaml:"client_id" env:"CREDENTIALS_CLIENT_ID"`
		ClientSecret string   `yaml:"client_secret" env:"CREDENTIALS_CLIENT_SECRET"`
		RedirectURL  string   `yaml:"redirect_url" env:"CREDENTIALS_REDIRECT_URL"`
		Scopes       []string `yaml:"scopes" env:"CREDENTIALS_SCOPES"`
	} `yaml:"credentials"`
}

func (*IntegrationCredentials) Validate

func (ic *IntegrationCredentials) Validate() error

type InvalidConfigurationParameterError

type InvalidConfigurationParameterError struct {
	Parameter string
	Reason    string
}

func (*InvalidConfigurationParameterError) Error

type OnlyofficeBuilderConfig

type OnlyofficeBuilderConfig struct {
	DocumentServerURL    string `yaml:"document_server_url" env:"ONLYOFFICE_DS_URL,overwrite"`
	DocumentServerSecret string `yaml:"document_server_secret" env:"ONLYOFFICE_DS_SECRET,overwrite"`
	DocumentServerHeader string `yaml:"document_server_header" env:"ONLYOFFICE_DS_HEADER,overwrite"`
	GatewayURL           string `yaml:"gateway_url" env:"ONLYOFFICE_GATEWAY_URL,overwrite"`
	CallbackURL          string `yaml:"callback_url" env:"ONLYOFFICE_CALLBACK_URL,overwrite"`
	AllowedDownloads     int    `yaml:"allowed_downloads" env:"ONLYOFFICE_ALLOWED_DOWNLOADS,overwrite"`
}

func (*OnlyofficeBuilderConfig) Validate

func (oc *OnlyofficeBuilderConfig) Validate() error

type OnlyofficeCallbackConfig

type OnlyofficeCallbackConfig struct {
	MaxSize       int64 `yaml:"max_size" env:"ONLYOFFICE_CALLBACK_MAX_SIZE,overwrite"`
	UploadTimeout int   `yaml:"upload_timeout" env:"ONLYOFFICE_CALLBACK_UPLOAD_TIMEOUT,overwrite"`
}

func (*OnlyofficeCallbackConfig) Validate

func (c *OnlyofficeCallbackConfig) Validate() error

type OnlyofficeConfig

type OnlyofficeConfig struct {
	Onlyoffice struct {
		Builder  OnlyofficeBuilderConfig  `yaml:"builder"`
		Callback OnlyofficeCallbackConfig `yaml:"callback"`
	} `yaml:"onlyoffice"`
}

func (*OnlyofficeConfig) Validate

func (oc *OnlyofficeConfig) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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