http

package
v0.0.0-...-3951416 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2025 License: Apache-2.0 Imports: 53 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FileInfoFasterFunc = files.FileInfoFaster

Functions

func LoggingMiddleware

func LoggingMiddleware(next http.Handler) http.Handler

LoggingMiddleware logs each request and its status code.

func StartHttp

func StartHttp(ctx context.Context, storage *bolt.BoltStore, shutdownComplete chan struct{})

Types

type AuthTokenMin

type AuthTokenMin struct {
	Key         string            `json:"key"`
	Name        string            `json:"name"`
	Created     int64             `json:"created"`
	Expires     int64             `json:"expires"`
	Permissions users.Permissions `json:"Permissions"`
}

type DirectDownloadResponse

type DirectDownloadResponse struct {
	Status      string `json:"status"`
	Hash        string `json:"hash"`
	DownloadURL string `json:"url"`
}

DirectDownloadResponse represents the response for direct download endpoint

type FileCache

type FileCache interface {
	Store(ctx context.Context, key string, value []byte) error
	Load(ctx context.Context, key string) ([]byte, bool, error)
	Delete(ctx context.Context, key string) error
}

type GroupListResponse

type GroupListResponse struct {
	Groups []string `json:"groups"`
}

type HttpResponse

type HttpResponse struct {
	Status  int    `json:"status,omitempty"`
	Message string `json:"message,omitempty"`
	Token   string `json:"token,omitempty"`
}

type OnlyOfficeCallback

type OnlyOfficeCallback struct {
	ChangesURL string   `json:"changesurl,omitempty"`
	Key        string   `json:"key,omitempty"`
	Status     int      `json:"status,omitempty"`
	URL        string   `json:"url,omitempty"`
	Users      []string `json:"users,omitempty"`
	UserData   string   `json:"userdata,omitempty"`
}

type OnlyOfficeJWTPayload

type OnlyOfficeJWTPayload struct {
	Key     string   `json:"key"`
	Status  int      `json:"status"`
	Users   []string `json:"users"`
	Actions []struct {
		Type   int    `json:"type"`
		UserID string `json:"userid"`
	} `json:"actions"`
}

OnlyOfficeJWTPayload represents the JWT payload structure for OnlyOffice callbacks

type ResponseWriterWrapper

type ResponseWriterWrapper struct {
	http.ResponseWriter
	StatusCode int

	PayloadSize int
	User        string
	// contains filtered or unexported fields
}

ResponseWriterWrapper wraps the standard http.ResponseWriter to capture the status code

func (*ResponseWriterWrapper) Flush

func (w *ResponseWriterWrapper) Flush()

func (*ResponseWriterWrapper) Write

func (w *ResponseWriterWrapper) Write(b []byte) (int, error)

Write is the method to write the response body and ensure WriteHeader is called

func (*ResponseWriterWrapper) WriteHeader

func (w *ResponseWriterWrapper) WriteHeader(statusCode int)

WriteHeader captures the status code and ensures it's only written once

type ShareResponse

type ShareResponse struct {
	*share.Link
	Username    string `json:"username,omitempty"`
	DownloadURL string `json:"downloadURL,omitempty"`
}

ShareResponse represents a share with computed username field and download URL

type TemplateRenderer

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

func (*TemplateRenderer) Render

func (t *TemplateRenderer) Render(w http.ResponseWriter, name string, data interface{}) error

Render renders a template document with headers and data

type UserRequest

type UserRequest struct {
	Which []string   `json:"which"`
	User  users.User `json:"data"`
}

Jump to

Keyboard shortcuts

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