constor

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2019 License: MIT Imports: 6 Imported by: 4

Documentation

Overview

package constor (concurrent storer) for storing items into a services.Fileserver concurrently

Index

Constants

View Source
const (
	MimeJson = "application/json"
	MimeJs   = "application/javascript"
	MimeBin  = "application/octet-stream"
	MimeHtml = "text/html"
	MimeZip  = "application/zip"
	MimeWasm = "application/wasm"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	Message   string
	Bucket    string
	Name      string
	Contents  []byte
	Mime      string
	Immutable bool
	Count     bool
	Wait      *sync.WaitGroup
	Send      bool
	Done      func()
}

type Storer

type Storer struct {
	// contains filtered or unexported fields
}
	pkg.jsgo.io (Pkg)
	-----------------
	<path>.<hash>.js        - deployed pkg / loader JS
	prelude.<hash>.js       - prelude JS
	<path>.<hash>.ax        - stripped archives
	/assets.zip             - assets zip
	<path>.<hash>.json      - package source bundle (for frizz.io)

	jsgo.io (Index)
	---------------
	<hash>.js               - index file deployed by play.jsgo.io
	<hash>/index.html       - index file deployed by play.jsgo.io

	<path>.js               - index file deployed by compile.jsgo.io
	<path>/index.html       - index file deployed by compile.jsgo.io
	<short-path>.js         - index file deployed by compile.jsgo.io
	<short-path>/index.html - index file deployed by compile.jsgo.io

	src.jsgo.io (Src)
	-----------------
	<hash>.json             - project shared by play.jsgo.io

	git.jsgo.io (Git)
    -----------------
    <repo-url>              - git repo archive (repo url is encoded with url.PathEscape)

func New

func New(ctx context.Context, fileserver services.Fileserver, send func(services.Message), workers int) *Storer

func (*Storer) Add

func (s *Storer) Add(item Item)

func (*Storer) Close

func (s *Storer) Close()

func (*Storer) Wait

func (s *Storer) Wait() error

func (*Storer) Worker

func (s *Storer) Worker(ctx context.Context)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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