Documentation ¶
Index ¶
- Variables
- type BasicConfig
- type GetMediaFunc
- type GetMediaResponse
- type GetMediaResponseData
- type GetMediaResponseURL
- type MediaProxy
- func (mp *MediaProxy) DisallowProxying()
- 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 ResponseError
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidMediaIDSyntax = errors.New("invalid media ID syntax")
Functions ¶
This section is empty.
Types ¶
type BasicConfig ¶
type GetMediaFunc ¶
type GetMediaFunc = func(ctx context.Context, mediaID string) (response GetMediaResponse, err error)
type GetMediaResponse ¶
type GetMediaResponse interface {
// contains filtered or unexported methods
}
type GetMediaResponseData ¶
type GetMediaResponseData struct { Reader io.ReadCloser ContentType string ContentLength int64 }
type GetMediaResponseURL ¶
type MediaProxy ¶
type MediaProxy struct { KeyServer *federation.KeyServer ProxyClient *http.Client ForceProxyLegacyFederation bool GetMedia GetMediaFunc PrepareProxyRequest func(*http.Request) FederationRouter *mux.Router LegacyMediaRouter *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) DisallowProxying ¶
func (mp *MediaProxy) DisallowProxying()
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 ¶
func (*ResponseError) Error ¶
func (err *ResponseError) Error() string
type ServerConfig ¶
Click to show internal directories.
Click to hide internal directories.