gitfs

package module
v0.0.0-...-529acec Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

README

Caddy Git Filesystem

This plugin allows you to serve files from a git repository directory by cloning it in-memory at Caddy boot.

Installation

Install the plugin using the xcaddy:

xcaddy build --with github.com/mohammed90/caddy-git-fs

Usage

{
	filesystem nginx-repo git https://github.com/caddyserver/nginx-adapter {
		refresh_period 10s # optional, no refresh when omitted
	}
}
example.com {
	file_server {
		fs nginx-repo
	}
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repo

type Repo struct {
	// The URL of the git repository
	URL string `json:"url,omitempty"`

	// The reference to clone the repository at.
	// An empty value means HEAD.
	Ref string `json:"ref,omitempty"`

	// The period between ref refreshes
	RefreshPeriod caddy.Duration `json:"refresh_period,omitempty"`
	// contains filtered or unexported fields
}

The `git` filesystem module uses a git repository as the virtual filesystem.

func (Repo) CaddyModule

func (Repo) CaddyModule() caddy.ModuleInfo

This method indicates that the type is a Caddy module. The returned ModuleInfo must have both a name and a constructor function. This method must not have any side-effects.

func (*Repo) Cleanup

func (r *Repo) Cleanup() error

Cleanup implements caddy.CleanerUpper.

func (*Repo) Open

func (r *Repo) Open(name string) (fs.File, error)

func (*Repo) Provision

func (r *Repo) Provision(ctx caddy.Context) (err error)

Provision implements caddy.Provisioner.

func (*Repo) Stat

func (r *Repo) Stat(name string) (fs.FileInfo, error)

func (*Repo) UnmarshalCaddyfile

func (r *Repo) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

UnmarshalCaddyfile implements caddyfile.Unmarshaler.

Jump to

Keyboard shortcuts

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