sprockets

package
v0.0.0-...-430806f Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2013 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package sprockets integrates the power of sprockets ( http://getsprockets.org ) with your go program.

To use in development:

  • Assets go in '/assets'
  • Install the 'rack' and 'sprockets' rubygems
  • run `rackup src/github.com/99designs/goodies/sprockets/config.ru`
  • In your app, call 'NewSprocketsServer("http://localhost:8012", "assets") to get a ViewHelper'
  • Use the ViewHelper to generate links to your assets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssetPipeline

type AssetPipeline interface {
	GetAssetUrl(name string) (template.HTMLAttr, error)
	GetAssetContents(name string) ([]byte, error)
}

type Manifest

type Manifest struct {
	Assets map[string]string `json:"assets"`
}

type SprocketsDirectory

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

func (*SprocketsDirectory) GetAssetContents

func (s *SprocketsDirectory) GetAssetContents(name string) ([]byte, error)

func (*SprocketsDirectory) GetAssetUrl

func (s *SprocketsDirectory) GetAssetUrl(name string) (template.HTMLAttr, error)

type SprocketsServer

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

func (*SprocketsServer) GetAssetContents

func (s *SprocketsServer) GetAssetContents(name string) ([]byte, error)

func (*SprocketsServer) GetAssetUrl

func (s *SprocketsServer) GetAssetUrl(name string) (template.HTMLAttr, error)

type ViewHelper

type ViewHelper struct {
	AssetPipeline
}

func NewSprocketsDirectory

func NewSprocketsDirectory(dirpath, prefix string) (ViewHelper, error)

func NewSprocketsServer

func NewSprocketsServer(baseUrl, manifestPath string) (ViewHelper, error)

func (*ViewHelper) JavascriptTag

func (vh *ViewHelper) JavascriptTag(name string) (template.HTML, error)

func (*ViewHelper) StylesheetLinkTag

func (vh *ViewHelper) StylesheetLinkTag(name string) (template.HTML, error)

Jump to

Keyboard shortcuts

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