entity

package
v0.0.0-...-de89868 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package entity определяет основные сущности для бизнес-логики (сервиса), сопоставления базы данных и объектов ответа HTTP, если они подходят.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

type Batch struct {
	Slug `json:"correlation_id" example:"1674872720465761244B_5"`            // Строковый идентификатор
	URL  `json:"original_url" example:"https://example.com/go/to/home.html"` // URL для сокращения
}

Batch -.

type CorrelationOrigin

type CorrelationOrigin []Batch

CorrelationOrigin -.

type CountURLs

type CountURLs int

CountURLs кол-во сокращённых URL в сервисе

type CountUsers

type CountUsers int

CountUsers кол-во пользователей в сервисе

type List

type List struct {
	ShortURL URL                                                                 `json:"short_url" example:"1674872720465761244B_5"` // Строковый идентификатор
	URL      `json:"original_url" example:"https://example.com/go/to/home.html"` // URL для сокращения
}

List -.

type Response

type Response []ShortenResponse

Response -.

type Short

type Short interface{}

Short -.

type ShortenResponse

type ShortenResponse struct {
	Slug `json:"correlation_id" example:"1674872720465761244B_5"`        // Строковый идентификатор
	URL  `json:"short_url" example:"https://example.com/correlation_id"` // URL для сокращения
}

ShortenResponse -.

type Shorturl

type Shorturl struct {
	Slug           `json:"slug,omitempty" example:"1674872720465761244B_5"`             // Строковый идентификатор
	URL            `json:"url,omitempty" example:"https://example.com/go/to/home.html"` // URL для сокращения
	*config.Config `json:"-"`
	UserID         `json:"user_id,omitempty"`
	Del            bool `json:"del"`
}

Shorturl хранит параметры URL.

type ShorturlResponse

type ShorturlResponse struct {
	URL `json:"result"` // URL для сокращения
}

ShorturlResponse -.

type Shorturls

type Shorturls []Shorturl

Shorturls -.

type Slug

type Slug string

Slug -.

type Static

type Static struct {
	CountURLs  `json:"urls,omitempty"`  // кол-во сокращённых URL в сервисе
	CountUsers `json:"users,omitempty"` // кол-во пользователей в сервисе
}

Static -.

type URL

type URL string

URL -.

type User

type User struct {
	UserID  `json:"user_id" example:"1674872720465761244B_5"`
	DelLink []Slug
	Urls    []List
}

User -.

type UserID

type UserID string

UserID -.

Jump to

Keyboard shortcuts

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