service

package
v0.0.0-...-568e8e9 Latest Latest
Warning

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

Go to latest
Published: May 7, 2016 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Server         *config.Server
	General        *GeneralConfig
	DataController *DataControllerConfig
}

Config is a struct that holds the configuration for Service

type DataControllerConfig

type DataControllerConfig struct {
	Type                       string
	SimpleDataDir              string
	SimpleTempDir              string
	SimpleChecksum             string
	SimpleVerifyClientChecksum bool
}

DataControllerConfig is a struct that holds configuration parameters for a data controller.

type GeneralConfig

type GeneralConfig struct {
	BaseURL                      string
	JWTKey, JWTSigningMethod     string
	AuthenticationServiceBaseURL string
	RequestBodyMaxSize           int64
}

GeneralConfig contains configuration parameters for general parts of the service.

type Service

type Service struct {
	Config         *Config
	SDK            *sdk.SDK
	DataController datacontroller.DataController
}

Service implements server.Service and handle all requests to the server.

func New

func New(cfg *Config) (*Service, error)

New will instantiate and return a new Service that implements server.Service.

func (*Service) Download

func (s *Service) Download(w http.ResponseWriter, r *http.Request)

Download streams a file to the client.

func (*Service) Endpoints

func (s *Service) Endpoints() map[string]map[string]http.HandlerFunc

Endpoints is a listing of all endpoints available in the Service.

func (*Service) Middleware

func (s *Service) Middleware(h http.Handler) http.Handler

Middleware provides an http.Handler hook wrapped around all requests. In this implementation, we authenticate the request.

func (*Service) Prefix

func (s *Service) Prefix() string

Prefix returns the string prefix used for all endpoints within this service.

func (*Service) Upload

func (s *Service) Upload(w http.ResponseWriter, r *http.Request)

Upload uploads a blob to user tree.

Jump to

Keyboard shortcuts

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