handler

package
v0.0.0-...-14d575d Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteError

func WriteError(w http.ResponseWriter, status int, reason string)

Types

type ActiveTasks

type ActiveTasks struct {
	Base
}

func (*ActiveTasks) ServeHTTP

func (s *ActiveTasks) ServeHTTP(w http.ResponseWriter, r *http.Request)

type AllDocsResponse

type AllDocsResponse struct {
	TotalRows int    `json:"total_rows"`
	Offset    int    `json:"offset"`
	Rows      []Rows `json:"rows"`
}

type Authenticator

type Authenticator struct {
	Base
	RequiresAdmin bool
}

func (Authenticator) Auth

func (a Authenticator) Auth(r *http.Request) (*model.Session, string)

func (Authenticator) Authenticate

func (a Authenticator) Authenticate(ctx context.Context, username, password string) port.SessionBuilder

func (Authenticator) DB

func (Authenticator) Do

type Base

type Base struct {
	Storage      *storage.Storage
	SessionStore sessions.Store
	Admins       model.AdminUsers
}

type BulkDocRequest

type BulkDocRequest struct {
	Docs []*model.Document `json:"docs"`
}

type ChangeDoc

type ChangeDoc struct {
	Seq     string                 `json:"seq"`
	ID      string                 `json:"id"`
	Changes []Revisions            `json:"changes"`
	Deleted bool                   `json:"deleted,omitempty"`
	Doc     map[string]interface{} `json:"doc,omitempty"`
}

type Cluster

type Cluster struct {
	Q int `json:"q"`
	N int `json:"n"`
	W int `json:"w"`
	R int `json:"r"`
}

type DBAll

type DBAll struct {
	Base
}

func (*DBAll) ServeHTTP

func (s *DBAll) ServeHTTP(w http.ResponseWriter, r *http.Request)

type DBChanges

type DBChanges struct {
	Base
}

func (*DBChanges) ServeHTTP

func (s *DBChanges) ServeHTTP(w http.ResponseWriter, r *http.Request)

type DBCreate

type DBCreate struct {
	Base
}

func (*DBCreate) ServeHTTP

func (s *DBCreate) ServeHTTP(w http.ResponseWriter, r *http.Request)

type DBDelete

type DBDelete struct {
	Base
}

func (*DBDelete) ServeHTTP

func (s *DBDelete) ServeHTTP(w http.ResponseWriter, r *http.Request)

type DBDocAttachmentDelete

type DBDocAttachmentDelete struct {
	Base
}

func (*DBDocAttachmentDelete) ServeHTTP

type DBDocAttachmentGet

type DBDocAttachmentGet struct {
	Base
}

func (*DBDocAttachmentGet) ServeHTTP

func (s *DBDocAttachmentGet) ServeHTTP(w http.ResponseWriter, r *http.Request)

type DBDocAttachmentPut

type DBDocAttachmentPut struct {
	Base
	Design bool
}

func (*DBDocAttachmentPut) ServeHTTP

func (s *DBDocAttachmentPut) ServeHTTP(w http.ResponseWriter, r *http.Request)

type DBDocDelete

type DBDocDelete struct {
	Base
	Design bool
	Local  bool
}

func (*DBDocDelete) ServeHTTP

func (s *DBDocDelete) ServeHTTP(w http.ResponseWriter, r *http.Request)

type DBDocGet

type DBDocGet struct {
	Base
	Design bool
	Local  bool
}

func (*DBDocGet) ServeHTTP

func (s *DBDocGet) ServeHTTP(w http.ResponseWriter, r *http.Request)

type DBDocPut

type DBDocPut struct {
	Base
}

func (*DBDocPut) ServeHTTP

func (s *DBDocPut) ServeHTTP(w http.ResponseWriter, r *http.Request)

type DBDocsAll

type DBDocsAll struct {
	Base
	Local bool
}

func (*DBDocsAll) ServeHTTP

func (s *DBDocsAll) ServeHTTP(w http.ResponseWriter, r *http.Request)

type DBDocsBulk

type DBDocsBulk struct {
	Base
	Design bool
}

func (*DBDocsBulk) ServeHTTP

func (s *DBDocsBulk) ServeHTTP(w http.ResponseWriter, r *http.Request)

type DBDocsFind

type DBDocsFind struct {
	Base
}

func (*DBDocsFind) ServeHTTP

func (s *DBDocsFind) ServeHTTP(w http.ResponseWriter, r *http.Request)

type DBEnsureFullCommit

type DBEnsureFullCommit struct {
	Base
}

func (*DBEnsureFullCommit) ServeHTTP

func (s *DBEnsureFullCommit) ServeHTTP(w http.ResponseWriter, r *http.Request)

type DBIndex

type DBIndex struct {
	Base
}

func (*DBIndex) ServeHTTP

func (s *DBIndex) ServeHTTP(w http.ResponseWriter, r *http.Request)

type DBIndexInfo

type DBIndexInfo struct {
	Base
}

func (*DBIndexInfo) ServeHTTP

func (s *DBIndexInfo) ServeHTTP(w http.ResponseWriter, r *http.Request)

type DBResponse

type DBResponse struct {
	DbName            string   `json:"db_name"`
	PurgeSeq          string   `json:"purge_seq"`
	UpdateSeq         string   `json:"update_seq"`
	Sizes             Sizes    `json:"sizes"`
	Props             Props    `json:"props"`
	DocDelCount       uint64   `json:"doc_del_count"`
	DocCount          uint64   `json:"doc_count"`
	DiskFormatVersion uint64   `json:"disk_format_version"`
	CompactRunning    bool     `json:"compact_running"`
	Cluster           *Cluster `json:"cluster"`
	InstanceStartTime string   `json:"instance_start_time"`
}

type DBSearch

type DBSearch struct {
	Base
}

type DBSecurityGet

type DBSecurityGet struct {
	Base
}

func (*DBSecurityGet) ServeHTTP

func (s *DBSecurityGet) ServeHTTP(w http.ResponseWriter, r *http.Request)

type DBSecurityPut

type DBSecurityPut struct {
	Base
}

func (*DBSecurityPut) ServeHTTP

func (s *DBSecurityPut) ServeHTTP(w http.ResponseWriter, r *http.Request)

type DBView

type DBView struct {
	Base
}

func (*DBView) ServeHTTP

func (s *DBView) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Database

type Database struct {
	Base
}

func (Database) Do

type EnsureFullCommitResponse

type EnsureFullCommitResponse struct {
	Ok                bool   `json:"ok"`
	InstanceStartTime string `json:"instance_start_time"`
}

type ErrorResponse

type ErrorResponse struct {
	Error  string `json:"error"`
	Reason string `json:"reason"`
}

type FindResponse

type FindResponse struct {
	Docs           []map[string]interface{} `json:"docs"`
	Bookmark       string                   `json:"bookmark,omitempty"`
	ExecutionStats *model.ExecutionStats    `json:"execution_stats"`
	Warning        string                   `json:"warning,omitempty"`
}

type Index

type Index struct{}

func (*Index) ServeHTTP

func (s *Index) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Info

type Info struct {
	Couchdb  string   `json:"couchdb"`
	Version  string   `json:"version"`
	GitSha   string   `json:"git_sha"`
	UUID     string   `json:"uuid"`
	Features []string `json:"features"`
	Vendor   Vendor   `json:"vendor"`
}

type MultipartResponse

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

func NewMultipartResponse

func NewMultipartResponse(db *storage.Database, w http.ResponseWriter) *MultipartResponse

func (*MultipartResponse) Close

func (r *MultipartResponse) Close()

func (*MultipartResponse) WriteDocument

func (r *MultipartResponse) WriteDocument(ctx context.Context, doc *model.Document) error

type Props

type Props struct {
}

type Revisions

type Revisions struct {
	Rev string `json:"rev"`
}

type Router

type Router struct {
	Storage      *storage.Storage
	SessionStore sessions.Store
	Admins       model.AdminUsers
}

func (Router) Build

func (router Router) Build(r *mux.Router) error

type Rows

type Rows struct {
	ID    string                 `json:"id,omitempty"`
	Key   interface{}            `json:"key,omitempty"`
	Value interface{}            `json:"value,omitempty"`
	Doc   map[string]interface{} `json:"doc,omitempty"`
}

type SearchResult

type SearchResult struct {
	TotalRows uint64      `json:"total_rows"`
	Bookmark  string      `json:"bookmark"`
	Rows      []SearchRow `json:"rows"`
}

type SearchRow

type SearchRow struct {
	ID     string                 `json:"id"`
	Order  []float64              `json:"order"`
	Fields map[string]interface{} `json:"fields"`
}

type SessionDelete

type SessionDelete struct {
	Base
}

func (*SessionDelete) ServeHTTP

func (s *SessionDelete) ServeHTTP(w http.ResponseWriter, r *http.Request)

type SessionGet

type SessionGet struct {
	Base
}

func (*SessionGet) ServeHTTP

func (s *SessionGet) ServeHTTP(w http.ResponseWriter, r *http.Request)

type SessionInfo

type SessionInfo struct {
	AuthenticationHandlers []string `json:"authentication_handlers"`
	Authenticated          string   `json:"authenticated,omitempty"`
}

type SessionPost

type SessionPost struct {
	Base
}

func (*SessionPost) ServeHTTP

func (s *SessionPost) ServeHTTP(w http.ResponseWriter, r *http.Request)

type SessionPostResponse

type SessionPostResponse struct {
	Ok             bool `json:"ok"`
	*model.Session `json:"userCtx,omitempty"`
}

type SessionResponse

type SessionResponse struct {
	Ok             bool          `json:"ok"`
	SessionUserCtx model.Session `json:"userCtx"`
	SessionInfo    SessionInfo   `json:"info"`
}

type SimpleDocResponse

type SimpleDocResponse struct {
	ID  string `json:"id"`
	Ok  bool   `json:"ok"`
	Rev string `json:"rev"`
}

type Sizes

type Sizes struct {
	File     uint64 `json:"file"`
	External uint64 `json:"external"`
	Active   uint64 `json:"active"`
}

type Task

type Task struct {
	Node           string `json:"node"`
	Pid            string `json:"pid"`
	ChangesDone    int    `json:"changes_done"`
	Database       string `json:"database"`
	DesignDocument string `json:"design_document"`
	Phase          string `json:"phase"`
	Progress       int    `json:"progress"`
	StartedOn      int    `json:"started_on"` // unix time
	TotalChanges   int    `json:"total_changes"`
	Type           string `json:"type"`
	UpdatedOn      int    `json:"updated_on"` // unix time
}

type UUIDs

type UUIDs struct{}

func (*UUIDs) ServeHTTP

func (s *UUIDs) ServeHTTP(w http.ResponseWriter, r *http.Request)

type UUIDsResponse

type UUIDsResponse struct {
	Uuids []string `json:"uuids"`
}

type UpdatesPending

type UpdatesPending struct {
	Minimum   uint64 `json:"minimum"`
	Preferred uint64 `json:"preferred"`
	Total     uint64 `json:"total"`
}

type Value

type Value struct {
	Rev string `json:"rev"`
}

type Vendor

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

type ViewIndex

type ViewIndex struct {
	UpdatesPending UpdatesPending `json:"updates_pending"`
	WaitingCommit  bool           `json:"waiting_commit"`
	WaitingClients int            `json:"waiting_clients"`
	UpdaterRunning bool           `json:"updater_running"`
	UpdateSeq      int            `json:"update_seq"`
	Sizes          ViewSizes      `json:"sizes"`
	Signature      string         `json:"signature"`
	PurgeSeq       int            `json:"purge_seq"`
	Language       string         `json:"language"`
	CompactRunning bool           `json:"compact_running"`
}

type ViewInfoResponse

type ViewInfoResponse struct {
	Name      string    `json:"name"`
	ViewIndex ViewIndex `json:"view_index"`
}

type ViewSizes

type ViewSizes struct {
	File     uint64 `json:"file"`
	External uint64 `json:"external"`
	Active   uint64 `json:"active"`
}

Jump to

Keyboard shortcuts

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