files

package
v1.30.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 3 Imported by: 4 modules, 7 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ActionCreate = "CREATE"
	ActionRead   = "READ"
	ActionUpdate = "UPDATE"
	ActionDelete = "DELETE"
)

Action consts

Variables

View Source
var AvroSchema = &avro.Schema{
	Definition: `{
			"type": "record",
			"name": "file-published",
			"fields": [
			  {"name": "path", "type": "string"},
			  {"name": "etag", "type": "string"},
			  {"name": "type", "type": "string"},
			  {"name": "sizeInBytes", "type": "string"}
			]
		  }`,
}

Functions

This section is empty.

Types

type EventsList added in v1.13.0

type EventsList struct {
	Count      int         `json:"count"`
	Limit      int         `json:"limit"`
	Offset     int         `json:"offset"`
	TotalCount int         `json:"total_count"`
	Items      []FileEvent `json:"items"`
}

EventsList represents a paginated list of file events

type FileEtagChange

type FileEtagChange struct {
	Path string
	Etag string
}

type FileEvent added in v1.13.0

type FileEvent struct {
	CreatedAt   *time.Time                `json:"created_at,omitempty" bson:"created_at,omitempty"`
	RequestedBy *RequestedBy              `json:"requested_by" bson:"requested_by"`
	Action      string                    `json:"action" bson:"action"`
	Resource    string                    `json:"resource" bson:"resource"`
	File        *StoredRegisteredMetaData `json:"file" bson:"file"`
}

FileEvent represents a file access event for the audit log

type FileMetaData added in v1.13.0

type FileMetaData struct {
	Path          string  `json:"path" bson:"path"`
	IsPublishable bool    `json:"is_publishable" bson:"is_publishable"`
	CollectionID  *string `json:"collection_id,omitempty" bson:"collection_id,omitempty"`
	BundleID      *string `json:"bundle_id,omitempty" bson:"bundle_id,omitempty"`
	Title         string  `json:"title" bson:"title"`
	SizeInBytes   uint64  `json:"size_in_bytes" bson:"size_in_bytes"`
	Type          string  `json:"type" bson:"type"`
	Licence       string  `json:"licence" bson:"licence"`
	LicenceURL    string  `json:"licence_url" bson:"licence_url"`
	State         string  `json:"state,omitempty" bson:"state,omitempty"`
	Etag          string  `json:"etag,omitempty" bson:"etag,omitempty"`
}

FileMetaData represents the basic file information stored in an event

type FilePublished

type FilePublished struct {
	Path        string `avro:"path"`
	Type        string `avro:"type"`
	Etag        string `avro:"etag"`
	SizeInBytes string `avro:"sizeInBytes"`
}

FilePublished provides an avro structure for an image published event

type HTTPServer

type HTTPServer interface {
	ListenAndServe() error
	Shutdown(ctx context.Context) error
}

HTTPServer defines the required methods from the HTTP server

type RequestedBy added in v1.13.0

type RequestedBy struct {
	ID    string `json:"id" bson:"id"`
	Email string `json:"email,omitempty" bson:"email,omitempty"`
}

RequestedBy represents the user who made the request

type StoredBundle added in v1.8.0

type StoredBundle struct {
	ID           string    `bson:"id" json:"id"`
	State        string    `bson:"state" json:"state"`
	LastModified time.Time `bson:"last_modified" json:"-"`
}

type StoredCollection added in v1.3.0

type StoredCollection struct {
	ID           string     `bson:"id" json:"id"`
	State        string     `bson:"state" json:"state"`
	LastModified time.Time  `bson:"last_modified" json:"-"`
	PublishedAt  *time.Time `bson:"published_at,omitempty" json:"-"`
}

type StoredContentItem added in v1.17.0

type StoredContentItem struct {
	DatasetID         string   `bson:"dataset_id" json:"dataset_id"`
	Edition           string   `bson:"edition" json:"edition"`
	Version           string   `bson:"version" json:"version"`
	PreviousSeriesId  []string `bson:"previous_series_id,omitempty" json:"previous_series_id,omitempty"`
	PreviousEditionId []string `bson:"previous_edition_id,omitempty" json:"previous_edition_id,omitempty"`
}

type StoredRegisteredMetaData

type StoredRegisteredMetaData struct {
	Path              string             `bson:"path" json:"path"`
	IsPublishable     bool               `bson:"is_publishable" json:"is_publishable"`
	CollectionID      *string            `bson:"collection_id,omitempty" json:"collection_id,omitempty"`
	BundleID          *string            `bson:"bundle_id,omitempty" json:"bundle_id,omitempty"`
	Title             string             `bson:"title" json:"title"`
	SizeInBytes       uint64             `bson:"size_in_bytes" json:"size_in_bytes"`
	Type              string             `bson:"type" json:"type"`
	Licence           string             `bson:"licence" json:"licence"`
	LicenceURL        string             `bson:"licence_url" json:"licence_url"`
	ContentItem       *StoredContentItem `bson:"content_item,omitempty" json:"content_item,omitempty"`
	CreatedAt         time.Time          `bson:"created_at" json:"-"`
	LastModified      time.Time          `bson:"last_modified" json:"-"`
	UploadCompletedAt *time.Time         `bson:"upload_completed_at,omitempty" json:"-"`
	PublishedAt       *time.Time         `bson:"published_at,omitempty" json:"-"`
	MovedAt           *time.Time         `bson:"moved_at,omitempty" json:"-"`
	State             string             `bson:"state" json:"state"`
	Etag              string             `bson:"etag" json:"etag"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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