Documentation ¶
Index ¶
- Variables
- type BasicConfig
- type GetMediaFunc
- type GetMediaResponse
- type GetMediaResponseCallback
- type GetMediaResponseData
- type GetMediaResponseFile
- type GetMediaResponseURL
- type GetMediaResponseWriter
- type MediaProxy
- func (mp *MediaProxy) DownloadMedia(w http.ResponseWriter, r *http.Request)
- func (mp *MediaProxy) DownloadMediaFederation(w http.ResponseWriter, r *http.Request)
- func (mp *MediaProxy) GetServerKey() *federation.SigningKey
- func (mp *MediaProxy) GetServerName() string
- func (mp *MediaProxy) Listen(cfg ServerConfig) error
- func (mp *MediaProxy) PreviewURLNotSupported(w http.ResponseWriter, r *http.Request)
- func (mp *MediaProxy) RegisterRoutes(router *mux.Router)
- func (mp *MediaProxy) UnknownEndpoint(w http.ResponseWriter, r *http.Request)
- func (mp *MediaProxy) UnsupportedMethod(w http.ResponseWriter, r *http.Request)
- func (mp *MediaProxy) UploadNotSupported(w http.ResponseWriter, r *http.Request)
- type ResponseErrordeprecated
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUploadNotSupported = mautrix.MUnrecognized. WithMessage("This is a media proxy and does not support media uploads."). WithStatus(http.StatusNotImplemented) ErrPreviewURLNotSupported = mautrix.MUnrecognized. WithMessage("This is a media proxy and does not support URL previews."). WithStatus(http.StatusNotImplemented) ErrUnknownEndpoint = mautrix.MUnrecognized. WithMessage("Unrecognized endpoint") ErrUnsupportedMethod = mautrix.MUnrecognized. WithMessage("Invalid method for endpoint"). WithStatus(http.StatusMethodNotAllowed) )
View Source
var ErrInvalidMediaIDSyntax = errors.New("invalid media ID syntax")
Functions ¶
This section is empty.
Types ¶
type BasicConfig ¶
type GetMediaFunc ¶
type GetMediaResponse ¶
type GetMediaResponse interface {
// contains filtered or unexported methods
}
type GetMediaResponseCallback ¶ added in v0.22.0
type GetMediaResponseCallback struct { Callback func(w io.Writer) (int64, error) ContentType string ContentLength int64 }
func (*GetMediaResponseCallback) GetContentLength ¶ added in v0.22.0
func (d *GetMediaResponseCallback) GetContentLength() int64
func (*GetMediaResponseCallback) GetContentType ¶ added in v0.22.0
func (d *GetMediaResponseCallback) GetContentType() string
type GetMediaResponseData ¶
type GetMediaResponseData struct { Reader io.ReadCloser ContentType string ContentLength int64 }
func (*GetMediaResponseData) GetContentLength ¶ added in v0.22.0
func (d *GetMediaResponseData) GetContentLength() int64
func (*GetMediaResponseData) GetContentType ¶ added in v0.22.0
func (d *GetMediaResponseData) GetContentType() string
type GetMediaResponseFile ¶ added in v0.22.0
type GetMediaResponseURL ¶
type GetMediaResponseWriter ¶ added in v0.22.0
type GetMediaResponseWriter interface { GetMediaResponse io.WriterTo GetContentType() string GetContentLength() int64 }
type MediaProxy ¶
type MediaProxy struct { KeyServer *federation.KeyServer ForceProxyLegacyFederation bool GetMedia GetMediaFunc PrepareProxyRequest func(*http.Request) FederationRouter *mux.Router ClientMediaRouter *mux.Router // contains filtered or unexported fields }
func New ¶
func New(serverName string, serverKey string, getMedia GetMediaFunc) (*MediaProxy, error)
func NewFromConfig ¶
func NewFromConfig(cfg BasicConfig, getMedia GetMediaFunc) (*MediaProxy, error)
func (*MediaProxy) DownloadMedia ¶
func (mp *MediaProxy) DownloadMedia(w http.ResponseWriter, r *http.Request)
func (*MediaProxy) DownloadMediaFederation ¶
func (mp *MediaProxy) DownloadMediaFederation(w http.ResponseWriter, r *http.Request)
func (*MediaProxy) GetServerKey ¶
func (mp *MediaProxy) GetServerKey() *federation.SigningKey
func (*MediaProxy) GetServerName ¶
func (mp *MediaProxy) GetServerName() string
func (*MediaProxy) Listen ¶
func (mp *MediaProxy) Listen(cfg ServerConfig) error
func (*MediaProxy) PreviewURLNotSupported ¶
func (mp *MediaProxy) PreviewURLNotSupported(w http.ResponseWriter, r *http.Request)
func (*MediaProxy) RegisterRoutes ¶
func (mp *MediaProxy) RegisterRoutes(router *mux.Router)
func (*MediaProxy) UnknownEndpoint ¶
func (mp *MediaProxy) UnknownEndpoint(w http.ResponseWriter, r *http.Request)
func (*MediaProxy) UnsupportedMethod ¶
func (mp *MediaProxy) UnsupportedMethod(w http.ResponseWriter, r *http.Request)
func (*MediaProxy) UploadNotSupported ¶
func (mp *MediaProxy) UploadNotSupported(w http.ResponseWriter, r *http.Request)
type ResponseError
deprecated
type ServerConfig ¶
Click to show internal directories.
Click to hide internal directories.