helix

package module
v0.0.0-...-81447e3 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2017 License: MIT Imports: 23 Imported by: 1

README

helix

Build Status Coverage Status

Go Link Data server. This is a parallel implementation of the Solid stack, which aims to simplify things a lot.

Documentation

Index

Constants

View Source
const HelixVersion = "0.1"

Variables

This section is empty.

Functions

func ETagMatch

func ETagMatch(header string, etag string) bool

func ETagNoneMatch

func ETagNoneMatch(header string, etag string) bool

func GetCurrentRoot

func GetCurrentRoot() string

func NewServer

func NewServer(cfg *Config) *web.Router

func NewTLSConfig

func NewTLSConfig(cert, key string) (*tls.Config, error)

func ParseBearerAuthorizationHeader

func ParseBearerAuthorizationHeader(header string) (string, error)

Types

type Accept

type Accept struct {
	Type, SubType string
	Q             float32
	Params        map[string]string
}

Accept structure is used to represent a clause in an HTTP Accept Header.

type AcceptList

type AcceptList []Accept

AcceptList is a sorted list of clauses from an Accept header.

func (AcceptList) Negotiate

func (al AcceptList) Negotiate(alternatives ...string) (contentType string, err error)

Negotiate the most appropriate contentType given the list of alternatives. Returns an error if no alternative is acceptable.

type Config

type Config struct {
	Conf       string
	Port       string
	Logging    bool
	Debug      bool
	SkipVerify bool
	Root       string
	StaticDir  string
	StaticPath string
	Hostname   string
	Cert       string
	Key        string
	TokenAge   int64
	HSTS       bool
	BoltPath   string
	BoltDB     *bolt.DB
	FilePath   string
	DataPath   string
	ACLPath    string
	MetaPath   string
}

func NewConfig

func NewConfig() *Config

func (*Config) LoadJSONFile

func (c *Config) LoadJSONFile(filename string) error

LoadJSONFile loads server configuration

func (*Config) StartBolt

func (c *Config) StartBolt() error

type Context

type Context struct {
	Config      *Config
	Store       map[string]*Graph
	User        string
	AccessToken string
}

func NewContext

func NewContext() *Context

func (*Context) Authentication

func (c *Context) Authentication(w web.ResponseWriter, req *web.Request, next web.NextMiddlewareFunc)

func (*Context) AuthenticationRequired

func (c *Context) AuthenticationRequired(w web.ResponseWriter, req *web.Request)

func (*Context) CORS

func (*Context) DeleteAccountHandler

func (c *Context) DeleteAccountHandler(w web.ResponseWriter, req *web.Request)

func (*Context) DeleteHandler

func (c *Context) DeleteHandler(w web.ResponseWriter, req *web.Request)

func (*Context) GetAccountHandler

func (c *Context) GetAccountHandler(w web.ResponseWriter, req *web.Request)

func (*Context) GetHandler

func (c *Context) GetHandler(w web.ResponseWriter, req *web.Request)

func (*Context) LoginHandler

func (c *Context) LoginHandler(w web.ResponseWriter, req *web.Request)

func (*Context) LogoutHandler

func (c *Context) LogoutHandler(w web.ResponseWriter, req *web.Request)

func (*Context) NewAccountHandler

func (c *Context) NewAccountHandler(w web.ResponseWriter, req *web.Request)

func (*Context) OptionsHandler

func (c *Context) OptionsHandler(w web.ResponseWriter, r *web.Request, methods []string)

func (*Context) PatchHandler

func (c *Context) PatchHandler(w web.ResponseWriter, req *web.Request)

func (*Context) PostHandler

func (c *Context) PostHandler(w web.ResponseWriter, req *web.Request)

func (*Context) PutHandler

func (c *Context) PutHandler(w web.ResponseWriter, req *web.Request)

PutHandler is used to create/overwrite non-RDF resources

func (*Context) RequestLogger

func (c *Context) RequestLogger(w web.ResponseWriter, req *web.Request, next web.NextMiddlewareFunc)

func (*Context) RootHandler

func (c *Context) RootHandler(w web.ResponseWriter, req *web.Request)

type Graph

type Graph struct {
	*rdf.Graph
	Etag string
}

func NewGraph

func NewGraph() *Graph

type User

type User struct {
	Username string
	Email    string
}

func NewUser

func NewUser() *User

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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