Categorygithub.com/guionardo/gs-bucket
modulepackage
0.0.7
Repository: https://github.com/guionardo/gs-bucket.git
Documentation: pkg.go.dev

# README

gs-bucket

github go-version SonarCloud analysis Quality Gate Status

deploy

this-version release

Temporary web file transfer

This application will run a HTTP server to store files

Swagger documentation

GS-Bucket API v0.0.6

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

This application will run a HTTP server to store files

Email: Guionardo Furlan Web: Guionardo Furlan

auth

get__auth_

GET /auth/

List all users allowed to publish

Parameters

NameInTypeRequiredDescription
api-keyheaderstringtrueAPI Key (master key)

Example responses

200 Response

[
  {
    "key": "string",
    "user": "string"
  }
]

Responses

StatusMeaningDescriptionSchema
200OKOKInline
401UnauthorizedUnauthorizedserver.ErrResponse
500Internal Server ErrorInternal Server Errorserver.ErrResponse

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
anonymous[domain.AuthResponse]falsenonenone
» keystringfalsenonenone
» userstringfalsenonenone
This operation does not require authentication

post__auth_{user}

POST /auth/{user}

Create a key for a user

Post a file to a pad, accessible for anyone

Parameters

NameInTypeRequiredDescription
api-keyheaderstringtrueAPI Key
userpathstringtrueUser name

Example responses

201 Response

{
  "key": "string",
  "user": "string"
}

Responses

StatusMeaningDescriptionSchema
201CreatedCreateddomain.AuthResponse
400Bad RequestRequired user nameserver.ErrResponse
401UnauthorizedUnauthorizedserver.ErrResponse
500Internal Server ErrorInternal Server Errorserver.ErrResponse
This operation does not require authentication

delete__auth_{user}

DELETE /auth/{user}

Delete all keys of user

Parameters

NameInTypeRequiredDescription
api-keyheaderstringtrueAPI Key
userpathstringtrueUser name

Example responses

201 Response

{
  "code": 0,
  "error": "string",
  "status": "string"
}

Responses

StatusMeaningDescriptionSchema
201CreatedCreatedserver.ErrResponse
401UnauthorizedUnauthorizedserver.ErrResponse
500Internal Server ErrorInternal Server Errorserver.ErrResponse
This operation does not require authentication

pads

get__pads

GET /pads

List pads

Example responses

200 Response

[
  {
    "content_type": "string",
    "creation_date": "string",
    "delete_after_read": true,
    "last_seen": "string",
    "name": "string",
    "owner": "string",
    "seen_count": 0,
    "size": 0,
    "slug": "string",
    "valid_until": "string"
  }
]

Responses

StatusMeaningDescriptionSchema
200OKOKInline
500Internal Server ErrorInternal Server Errorserver.ErrResponse

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
anonymous[domain.File]falsenonenone
» content_typestringfalsenonenone
» creation_datestringfalsenonenone
» delete_after_readbooleanfalsenonenone
» last_seenstringfalsenonenone
» namestringfalsenonenone
» ownerstringfalsenonenone
» seen_countintegerfalsenonenone
» sizeintegerfalsenonenone
» slugstringfalsenonenone
» valid_untilstringfalsenonenone
This operation does not require authentication

post__pads

POST /pads

Create a pad

Post a file to a pad, accessible for anyone

Body parameter

"string"

Parameters

NameInTypeRequiredDescription
api-keyheaderstringtrueAPI Key
namequerystringtrueFile name
slugquerystringfalseSlug or easy name (if not informed, will be used a hash value)
ttlquerystringfalseTime to live (i.Ex 300s, 1.5h or 2h45m). Valid time units are: 's', 'm', 'h')
delete-after-readquerybooleanfalseIf informed, the file will be deleted after first download.
bodybodystringtrueContent

Example responses

201 Response

{
  "content_type": "string",
  "creation_date": "string",
  "delete_after_read": true,
  "last_seen": "string",
  "name": "string",
  "owner": "string",
  "seen_count": 0,
  "size": 0,
  "slug": "string",
  "valid_until": "string"
}

Responses

StatusMeaningDescriptionSchema
201CreatedCreateddomain.File
400Bad RequestBad Requestserver.ErrResponse
500Internal Server ErrorInternal Server Errorserver.ErrResponse
507Insufficient StorageInsufficient Storageserver.ErrResponse
This operation does not require authentication

get__pads_{code}

GET /pads/{code}

Download a pad

Parameters

NameInTypeRequiredDescription
codepathstringtrueFile code

Example responses

200 Response

"string"

Responses

StatusMeaningDescriptionSchema
200OKOKstring
404Not FoundNot Foundserver.ErrResponse
500Internal Server ErrorInternal Server Errorserver.ErrResponse
This operation does not require authentication

delete__pads_{code}

DELETE /pads/{code}

Delete a pad

Parameters

NameInTypeRequiredDescription
codepathstringtrueFile code

Example responses

200 Response

"string"

Responses

StatusMeaningDescriptionSchema
200OKOKstring
404Not FoundNot Foundserver.ErrResponse
500Internal Server ErrorInternal Server Errorserver.ErrResponse
This operation does not require authentication

Schemas

domain.AuthResponse

{
  "key": "string",
  "user": "string"
}

Properties

NameTypeRequiredRestrictionsDescription
keystringfalsenonenone
userstringfalsenonenone

domain.File

{
  "content_type": "string",
  "creation_date": "string",
  "delete_after_read": true,
  "last_seen": "string",
  "name": "string",
  "owner": "string",
  "seen_count": 0,
  "size": 0,
  "slug": "string",
  "valid_until": "string"
}

Properties

NameTypeRequiredRestrictionsDescription
content_typestringfalsenonenone
creation_datestringfalsenonenone
delete_after_readbooleanfalsenonenone
last_seenstringfalsenonenone
namestringfalsenonenone
ownerstringfalsenonenone
seen_countintegerfalsenonenone
sizeintegerfalsenonenone
slugstringfalsenonenone
valid_untilstringfalsenonenone

server.ErrResponse

{
  "code": 0,
  "error": "string",
  "status": "string"
}

Properties

NameTypeRequiredRestrictionsDescription
codeintegerfalsenoneapplication-specific error code
errorstringfalsenoneapplication-level error message, for debugging
statusstringfalsenoneuser-level status message

swagger data generated @ Fri Aug 25 2023 17:08:18 GMT+0000 (Coordinated Universal Time)

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# Variables

No description provided by the author