gop

package module
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

README

Project logo

GOP

Status GitHub Issues GitHub Pull Requests License


📝 Table of Contents

🧐 About

GOP: "Git Object Proxy" is a generic library used to implement moduling systems in programming languages. GOP defines two main interfaces that can be used to retrieve and cache resources from different sources. See revision2.md to see design doc.

🏁 Getting Started

See deployment for notes on how to deploy the project on a live system.

Prerequisites

What things you need to install the software and how to install them.

  • Go 1.13: currently google cloud functions only support upto the go 1.13 runtime

🔧 Running the tests

go test ./... -short

🎈 Usage

go run ./cmd/servegop

  • This will run a gop server on localhost:8080

🚀 Deployment

⛏️ Built Using

✍️ Authors

🎉 Acknowledgements

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CORSEnabledFunction

func CORSEnabledFunction(w http.ResponseWriter, r *http.Request)

func HandleErr

func HandleErr(w http.ResponseWriter, err error)

func ServeHTTP

func ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP is a http.HandlerFunc, can be used in deployments like cloud functions

Types

type GopperService

type GopperService struct {
	gop3.Gopper
	gop3.Retriever
	gop3.Resolver
}
GopperService is an implementation of Gopper that will fall back to a git retriever if the file can't be found in

its data source

func NewGopper

func NewGopper(cachelocation, fsType, tokenEnv string) (*GopperService, error)

NewGopper returns a GopperService for a config; This Gopper can use an os filesystem, memory filesystem or a gcs bucket

func (GopperService) Retrieve

func (a GopperService) Retrieve(resource string) ([]byte, bool, error)
Retrieve attempts to retrieve a file from GopperService.Gopper, if this fails then it will fall back to using a

git retriever

Jump to

Keyboard shortcuts

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