Documentation
¶
Overview ¶
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: AGPL-3.0-or-later
Index ¶
- func ImportData(s BackupStore, b *Backup, force bool) error
- func Pack(files map[string][]byte, passphrase string) ([]byte, error)
- func Unpack(data []byte, passphrase string) (map[string][]byte, error)
- type Backup
- type BackupChannel
- type BackupDM
- type BackupMessage
- type BackupRole
- type BackupStore
- type BackupUser
- type ObjectInfo
- type S3Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ImportData ¶
func ImportData(s BackupStore, b *Backup, force bool) error
ImportData inserts backup data into the store in dependency order. If force is false, it refuses to import into a non-empty database. If force is true and the database is non-empty, it wipes all data first.
Types ¶
type Backup ¶
type Backup struct {
Version int `json:"version"`
ExportedAt time.Time `json:"exported_at"`
Users []BackupUser `json:"users"`
Channels []BackupChannel `json:"channels"`
ChannelMembers map[string][]string `json:"channel_members"`
Messages []BackupMessage `json:"messages"`
Roles []BackupRole `json:"roles"`
RolePermissions map[string][]string `json:"role_permissions"`
Settings map[string]string `json:"settings"`
DMs []BackupDM `json:"dms"`
}
Backup is the top-level JSON-serializable backup format.
type BackupChannel ¶
type BackupChannel struct {
Name string `json:"name"`
Public bool `json:"public"`
Type string `json:"type"`
}
BackupChannel represents a non-DM channel in the backup.
type BackupDM ¶
type BackupDM struct {
User1 string `json:"user1"`
User2 string `json:"user2"`
ChannelName string `json:"channel_name"`
}
BackupDM represents a direct message channel in the backup.
type BackupMessage ¶
type BackupMessage struct {
ID int `json:"id"`
Channel string `json:"channel"`
From string `json:"from"`
Body string `json:"body"`
ThreadID *int `json:"thread_id"`
Mentions []string `json:"mentions"`
CreatedAt time.Time `json:"created_at"`
}
BackupMessage represents a message in the backup.
type BackupRole ¶
BackupRole represents a role in the backup.
type BackupStore ¶
type BackupStore = domain.BackupStore
BackupStore is an alias for domain.BackupStore, re-exported from this package for backward compatibility with existing callers (cmd/backup, tests). The canonical definition lives in pkg/domain/ports.go so that any reader of the central ports file sees the full production storage contract.
type BackupUser ¶
type BackupUser struct {
Username string `json:"username"`
Password string `json:"password"`
Role string `json:"role"`
Type string `json:"type"`
}
BackupUser represents a user in the backup.
type ObjectInfo ¶
ObjectInfo describes a backup object in S3.
type S3Config ¶
type S3Config struct {
Bucket string
Region string
Endpoint string
AccessKey string
SecretKey string
}
S3Config holds the configuration for connecting to an S3-compatible store.
func (*S3Config) List ¶
func (c *S3Config) List(ctx context.Context) ([]ObjectInfo, error)
List returns all objects in the bucket with the "sharkfin-backup-" prefix.