Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CDNMetadataEntry ¶
type CDNMetadataEntry struct {
ID uuid.UUID `json:"id" bson:"id"`
CreatedAt time.Time `json:"created_at" bson:"created_at"`
UpdatedAt time.Time `json:"updated_at" bson:"updated_at"`
Module string `json:"module" bson:"module"`
RedirectURL string `json:"redirect_url" bson:"redirect_url"`
}
CDNMetadataEntry stores the module name and cdn URL.
func (*CDNMetadataEntry) TableName ¶
func (e *CDNMetadataEntry) TableName() string
TableName changes the default name which would be c_d_n_metadata_entry
type Getter ¶
type Getter interface {
// Get gets the base URL for the given module.
// Returns ErrNotFound if the module isn't found, and another
// non-nil error on any other error encountered.
//
// This method does not touch the CDN itself. Olympus should just
// redirect vgo to the CDN so that vgo downloads module data directly
// from there.
//
// If something went wrong getting the module metadata, returns a non-nil
// error.
Get(module string) (string, error)
}
Getter gets the details about a given module and returns the base URL of the module metadata and content. For example, if gomods.io/my/module is requested by the 'vgo get' command, this might return 'https://mycdn.com/gomods.io/my/module'
Then, the following URLs would be available:
- https://mycdn.com/gomods.io/my/module/@v/list - https://mycdn.com/gomods.io/my/module/@v/{version}.info - https://mycdn.com/gomods.io/my/module/@v/{version}.mod - https://mycdn.com/gomods.io/my/module/@v/{version}.zip
type Saver ¶
type Saver interface {
// Save saves the module and base URL pair.
Save(module, redirectURL string) error
}
Saver saves the module's base URL of the module metadata and content. For example: module: gomods.io/my/module - URL: 'https://mycdn.com/gomods.io/my/module'
type Storage ¶
Storage is a complete cdn metadata storage backend (i.e. file system, database) implementation - a getter and saver
type StorageConnector ¶
StorageConnector is a regular storage Storage with Connect functionality
func NoOpStorageConnector ¶
func NoOpStorageConnector(s Storage) StorageConnector
NoOpStorageConnector wraps storage Storage with Connect functionality