save

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(log *slog.Logger, urlSaver URLSaver) http.HandlerFunc

Types

type Request

type Request struct {
	URL   string `json:"url" validate:"required,url"`
	Alias string `json:"alias"`
}

type Response

type Response struct {
	resp.Response
	Alias string `json:"alias,omitempty"`
}

type URLSaver

type URLSaver interface {
	SaveURL(ctx context.Context, urlToSave string, alias string) error
}

Jump to

Keyboard shortcuts

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