stream

package
v0.2.1 Latest Latest
Warning

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

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

README

Stream data to client via websocket

Handler for /ws/:RequestID/:Token/ request. Subscribe client on messages:

  • user.:Token
  • once.widget.:RequestID

Documentation

Overview

Package upload implements image upload handlers.

Index

Constants

View Source
const (
	// ErrNoSingleFile returned when does not contain single file in field 'file'
	ErrNoSingleFile = "field 'file' does not contains single item"
)

Variables

View Source
var (
	// ErrNoAuth returned on Internal Server Error (no auth for upload)
	ErrNoAuth       = errors.New("This endpoint must be under AuthRequired")
	ErrNotSupported = errors.New("This ws call is not supported")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	CookieName   string `long:"cookie" default:"sfs_auth" description:"Auth cookie name"`
	HeaderName   string `long:"header" default:"X-SFS-Auth" description:"Auth header name"`
	CookieMaxAge int    `long:"cookie_ttl" default:"3600" description:"Auth cookie TTL"`
}

Config holds all config vars

type Service

type Service struct {
	Config     *Config
	Log        *log.SugaredLogger
	ContextKey string
	// contains filtered or unexported fields
}

Service holds upload service

func New

func New(cfg Config, logger *log.SugaredLogger, ps *pubsub.Service, key string) *Service

New creates an Service object

func (Service) SetupRouter

func (srv Service) SetupRouter(r *gin.Engine)

Jump to

Keyboard shortcuts

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