frontier

package module
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: MIT Imports: 9 Imported by: 0

README

status PkgGoDev

frontier

frontier is a deployment tool for Amazon CloudFront Functions.

The concept is heavily inspired by Lambroll.

Synopsis

Simply run as below:

frontier deploy

frontier deploy does:

  • create or update function
  • publish the function by default
    • you can stop this behavior by using --publish=false

frontier deploy does not:

  • compile your function code implicitly
  • or anything else
Function Config (function.yml)

The function config is almost same as CreateFunction or UpdateFunction's input except of Code.

---

name: your-edge-function
config:
  comment: this is edge function
  runtime: cloudfront-js-1.0
code:
  path: ./path/to/fn.js

fn.js:

function handler(event) {
  var response = event.response,
    origin = event.request.headers.origin;
  response.headers["access-control-allow-origin"] = {
    value: origin.value,
  };
  return response;
}

Installation

go install github.com/aereal/frontier@latest

License

See LICENSE file.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssociatedDistribution added in v0.5.0

type AssociatedDistribution struct {
	DomainName string
	ARN        string
	ID         string
	IsEnabled  bool
	IsStaging  bool
	Status     string
}

type AssociatedFunction added in v0.5.0

type AssociatedFunction struct {
	ARN string
}

type CacheBehavior added in v0.5.0

type CacheBehavior struct {
	CachePolicyID  string
	TargetOriginID string
	IsDefault      bool
}

type Deployer

type Deployer struct {
	// contains filtered or unexported fields
}

func NewDeployer

func NewDeployer(clientProvider cf.Provider) *Deployer

func (*Deployer) Deploy

func (d *Deployer) Deploy(ctx context.Context, configPath string, publish bool) error

type Function

type Function struct {
	Name   string          `yaml:"name"`
	Code   *FunctionCode   `yaml:"code"`
	Config *FunctionConfig `yaml:"config"`
}

func ParseConfigFromPath added in v0.5.0

func ParseConfigFromPath(configPath string) (*Function, error)

type FunctionAssociation added in v0.5.0

type FunctionAssociation struct {
	Distribution  AssociatedDistribution
	CacheBehavior CacheBehavior
	EventType     string
	Function      AssociatedFunction
}

type FunctionCode added in v0.1.1

type FunctionCode struct {
	Path string `yaml:"path"`
}

type FunctionConfig

type FunctionConfig struct {
	Comment string                `yaml:"comment"`
	Runtime types.FunctionRuntime `yaml:"runtime"`
}

type Importer added in v0.4.0

type Importer struct {
	// contains filtered or unexported fields
}

func NewImporter added in v0.4.0

func NewImporter(clientProvider cf.Provider) *Importer

func (*Importer) Import added in v0.4.0

func (i *Importer) Import(ctx context.Context, functionName string, configStream io.Writer, functionStream *WritableFile) error

type MissingFunctionNameError added in v0.5.0

type MissingFunctionNameError struct{}

func (MissingFunctionNameError) Error added in v0.5.0

func (MissingFunctionNameError) Is added in v0.5.0

type Renderer added in v0.2.0

type Renderer struct{}

func NewRenderer added in v0.2.0

func NewRenderer() *Renderer

func (*Renderer) Render added in v0.2.0

func (r *Renderer) Render(ctx context.Context, configPath string, output io.Writer) error

type WritableFile added in v0.4.0

type WritableFile struct {
	io.Writer
	FilePath string
}

Directories

Path Synopsis
cmd
frontier command
controller
internal
cf
cli

Jump to

Keyboard shortcuts

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