importdata

package
v0.17.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BasePath = "/v1/import"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

type Module struct {
	// contains filtered or unexported fields
}

func New

func New(processor *processing.Processor) *Module

func (*Module) ImportPOSTHandler

func (m *Module) ImportPOSTHandler(c *gin.Context)

ImportPOSTHandler swagger:operation POST /api/v1/import importData

Upload some CSV-formatted data to your account.

This can be used to migrate data from a Mastodon-compatible CSV file to a GoToSocial account.

Uploaded data will be processed asynchronously, and not all entries may be processed depending on domain blocks, user-level blocks, network availability of referenced accounts and statuses, etc.

---
tags:
- import-export

consumes:
- multipart/form-data

produces:
- application/json

parameters:
-
	name: data
	in: formData
	description: The CSV data file to upload.
	type: file
	required: true
-
	name: type
	in: formData
	description: >-
		Type of entries contained in the data file:

		- `following` - accounts to follow.
		- `blocks` - accounts to block.
	type: string
	required: true
-
	name: mode
	in: formData
	description: >-
		Mode to use when creating entries from the data file:

		- `merge` to merge entries in file with existing entries.
		- `overwrite` to replace existing entries with entries in file.
	type: string
	default: merge

security:
- OAuth2 Bearer:
	- write:accounts

responses:
	'202':
		description: Upload accepted.
	'400':
		description: bad request
	'401':
		description: unauthorized
	'406':
		description: not acceptable
	'500':
		description: internal server error

func (*Module) Route

func (m *Module) Route(attachHandler func(method string, path string, f ...gin.HandlerFunc) gin.IRoutes)

Jump to

Keyboard shortcuts

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