api

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Copyright paskal.maksim@gmail.com 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.

Copyright paskal.maksim@gmail.com 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

View Source
const (
	MessageTypePut    = "put"
	MessageTypePatch  = "patch"
	MessageTypeDelete = "delete"
	MessageTypeCopy   = "copy"
	MessageTypeMove   = "move"
)

Variables

View Source
var (
	ErrFileNotFound      = errors.New("file not found")
	ErrFileMustNotExists = errors.New("file must not exists")
	ErrFileMustExists    = errors.New("file must exists")
	ErrSHA256Failed      = errors.New("file SHA256 check failed")
)

Functions

func Init

func Init() error

func ProcessMessage

func ProcessMessage(message Message) error

func SendWithRetry added in v0.1.9

func SendWithRetry(message Message) error

Types

type Message

type Message struct {
	ID                string `json:"id"`
	Type              string `json:"type"`
	Destination       string `json:"destination"`
	FileName          string `json:"fileName"`
	NewFileName       string `json:"newFileName"`
	Force             bool   `json:"force"`
	FileContent       string `json:"fileContent"`
	FileContentBase64 string `json:"fileContentBase64"`
	SHA256            string `json:"sha256"`
}

func GetMessageFromValue

func GetMessageFromValue(value string) (Message, error)

func (*Message) String added in v0.1.9

func (m *Message) String() string

type Response

type Response struct {
	Type       string `json:"type"`
	FileName   string `json:"fileName"`
	StatusCode int    `json:"statusCode"`
	StatusText string `json:"statusText"`
}

Jump to

Keyboard shortcuts

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