tombstone.go (2212B)
1 // GoToSocial 2 // Copyright (C) GoToSocial Authors admin@gotosocial.org 3 // SPDX-License-Identifier: AGPL-3.0-or-later 4 // 5 // This program is free software: you can redistribute it and/or modify 6 // it under the terms of the GNU Affero General Public License as published by 7 // the Free Software Foundation, either version 3 of the License, or 8 // (at your option) any later version. 9 // 10 // This program is distributed in the hope that it will be useful, 11 // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 // GNU Affero General Public License for more details. 14 // 15 // You should have received a copy of the GNU Affero General Public License 16 // along with this program. If not, see <http://www.gnu.org/licenses/>. 17 18 // Package gtsmodel contains types used *internally* by GoToSocial and added/removed/selected from the database. 19 // These types should never be serialized and/or sent out via public APIs, as they contain sensitive information. 20 // The annotation used on these structs is for handling them via the bun-db ORM. 21 // See here for more info on bun model annotations: https://bun.uptrace.dev/guide/models.html 22 package gtsmodel 23 24 import ( 25 "time" 26 ) 27 28 // Tombstone represents either a remote fediverse account, object, activity etc which has been deleted. 29 // It's useful in cases where a remote account has been deleted, and we don't want to keep trying to process 30 // subsequent activities from that account, or deletes which target it. 31 type Tombstone struct { 32 ID string `validate:"required,ulid" bun:"type:CHAR(26),pk,nullzero,notnull,unique"` // id of this item in the database 33 CreatedAt time.Time `validate:"-" bun:"type:timestamptz,nullzero,notnull,default:current_timestamp"` // when was item created 34 UpdatedAt time.Time `validate:"-" bun:"type:timestamptz,nullzero,notnull,default:current_timestamp"` // when was item last updated 35 Domain string `validate:"omitempty,fqdn" bun:",nullzero,notnull"` // Domain of the Object/Actor. 36 URI string `validate:"required,url" bun:",nullzero,notnull,unique"` // ActivityPub URI for this Object/Actor. 37 }