http

package
v0.0.0-...-67087f0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2015 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INVALID_CREDENTIALS_MSG  = "Invalid database/username/password"
	JSON_PRETTY_PRINT_INDENT = "    "
)

Variables

This section is empty.

Functions

func CompressionHandler

func CompressionHandler(enableCompression bool, handler libhttp.HandlerFunc) libhttp.HandlerFunc

func CompressionHeaderHandler

func CompressionHeaderHandler(handler libhttp.HandlerFunc, version string) libhttp.HandlerFunc

func HeaderHandler

func HeaderHandler(handler libhttp.HandlerFunc, version string) libhttp.HandlerFunc

func TimePrecisionFromString

func TimePrecisionFromString(s string) (TimePrecision, error)

Types

type AllPointsWriter

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

type ApiUser

type ApiUser struct {
	Name string `json:"name"`
}

type ChunkWriter

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

type CompressedResponseWriter

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

func NewCompressionResponseWriter

func NewCompressionResponseWriter(useCompression bool, rw libhttp.ResponseWriter, req *libhttp.Request) *CompressedResponseWriter

func (*CompressedResponseWriter) Flush

func (self *CompressedResponseWriter) Flush()

func (*CompressedResponseWriter) Header

func (self *CompressedResponseWriter) Header() libhttp.Header

func (*CompressedResponseWriter) Write

func (self *CompressedResponseWriter) Write(bs []byte) (int, error)

func (*CompressedResponseWriter) WriteHeader

func (self *CompressedResponseWriter) WriteHeader(responseCode int)

type ContinuousQuery

type ContinuousQuery struct {
	Id    int64  `json:"id"`
	Query string `json:"query"`
}

type DatabaseConfig

type DatabaseConfig struct {
	Spaces            []*cluster.ShardSpace `json:"spaces"`
	ContinuousQueries []string              `json:"continuousQueries"`
}

type Flusher

type Flusher interface {
	Flush() error
}

type HttpServer

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

func NewHttpServer

func NewHttpServer(config *configuration.Configuration, theCoordinator api.Coordinator, userManager UserManager, clusterConfig *cluster.ClusterConfiguration, raftServer *coordinator.RaftServer) *HttpServer

func (*HttpServer) Close

func (self *HttpServer) Close()

func (*HttpServer) EnableSsl

func (self *HttpServer) EnableSsl(addr, certPath string)

func (*HttpServer) ListenAndServe

func (self *HttpServer) ListenAndServe()

func (*HttpServer) Serve

func (self *HttpServer) Serve(listener net.Listener)

type NewContinuousQuery

type NewContinuousQuery struct {
	Query string `json:"query"`
}

type NewUser

type NewUser struct {
	Name     string `json:"name"`
	Password string `json:"password"`
	IsAdmin  bool   `json:"isAdmin"`
	ReadFrom string `json:"readFrom"`
	WriteTo  string `json:"writeTo"`
}

type Point

type Point struct {
	Timestamp      int64         `json:"timestamp"`
	SequenceNumber uint32        `json:"sequenceNumber"`
	Values         []interface{} `json:"values"`
}

type SeriesWriter

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

func NewSeriesWriter

func NewSeriesWriter(yield func(*protocol.Series) error) *SeriesWriter

func (*SeriesWriter) Close

func (self *SeriesWriter) Close() error

func (*SeriesWriter) Name

func (self *SeriesWriter) Name() string

func (*SeriesWriter) Next

func (self *SeriesWriter) Next() engine.Processor

func (*SeriesWriter) Yield

func (self *SeriesWriter) Yield(series *protocol.Series) (bool, error)

type UpdateClusterAdminUser

type UpdateClusterAdminUser struct {
	Password string `json:"password"`
}

type UserDetail

type UserDetail struct {
	Name     string `json:"name"`
	IsAdmin  bool   `json:"isAdmin"`
	WriteTo  string `json:"writeTo"`
	ReadFrom string `json:"readFrom"`
}

type UserManager

type UserManager interface {
	// Returns the user for the given db and that has the given
	// credentials, falling back to cluster admins
	AuthenticateDbUser(db, username, password string) (common.User, error)
	// Returns the cluster admin with the given credentials
	AuthenticateClusterAdmin(username, password string) (common.User, error)
	// Create a cluster admin user, it's an error if requester isn't a cluster admin
	CreateClusterAdminUser(request common.User, username, password string) error
	// Delete a cluster admin. Same restrictions as CreateClusterAdminUser
	DeleteClusterAdminUser(requester common.User, username string) error
	// Change cluster admin's password. It's an error if requester isn't a cluster admin
	ChangeClusterAdminPassword(requester common.User, username, password string) error
	// list cluster admins. only a cluster admin can list the other cluster admins
	ListClusterAdmins(requester common.User) ([]string, error)
	// Create a db user, it's an error if requester isn't a db admin or cluster admin
	CreateDbUser(request common.User, db, username, password string, permissions ...string) error
	// Delete a db user. Same restrictions apply as in CreateDbUser
	DeleteDbUser(requester common.User, db, username string) error
	// Change db user's password. It's an error if requester isn't a cluster admin or db admin
	ChangeDbUserPassword(requester common.User, db, username, password string) error
	ChangeDbUserPermissions(requester common.User, db, username, readPermissions, writePermissions string) error
	// list cluster admins. only a cluster admin or the db admin can list the db users
	ListDbUsers(requester common.User, db string) ([]common.User, error)
	GetDbUser(requester common.User, db, username string) (common.User, error)
	// make user a db admin for 'db'. It's an error if the requester
	// isn't a db admin or cluster admin or if user isn't a db user
	// for the given db
	SetDbAdmin(requester common.User, db, username string, isAdmin bool) error
}

type Writer

type Writer interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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