Documentation ¶
Index ¶
- type AtmosCamoBackend
- type ImageProxy
- func (proxy *ImageProxy) Close()
- func (proxy *ImageProxy) GetImage(w http.ResponseWriter, r *http.Request, imageURL string)
- func (proxy *ImageProxy) GetProxiedImageURL(imageURL string) string
- func (proxy *ImageProxy) GetUnproxiedImageURL(proxiedURL string) string
- func (proxy *ImageProxy) OnConfigChange(oldConfig, newConfig *model.Config)
- type ImageProxyBackend
- type LocalBackend
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AtmosCamoBackend ¶
type AtmosCamoBackend struct {
// contains filtered or unexported fields
}
func (*AtmosCamoBackend) GetImage ¶
func (backend *AtmosCamoBackend) GetImage(w http.ResponseWriter, r *http.Request, imageURL string)
func (*AtmosCamoBackend) GetProxiedImageURL ¶
func (backend *AtmosCamoBackend) GetProxiedImageURL(imageURL string) string
func (*AtmosCamoBackend) GetUnproxiedImageURL ¶
func (backend *AtmosCamoBackend) GetUnproxiedImageURL(proxiedURL string) string
type ImageProxy ¶
type ImageProxy struct { ConfigService configservice.ConfigService HTTPService httpservice.HTTPService // contains filtered or unexported fields }
An ImageProxy is the public interface for Mattermost's image proxy. An instance of ImageProxy should be created using MakeImageProxy which requires a configService and an HTTPService provided by the server.
func MakeImageProxy ¶
func MakeImageProxy(configService configservice.ConfigService, httpService httpservice.HTTPService) *ImageProxy
func (*ImageProxy) Close ¶
func (proxy *ImageProxy) Close()
func (*ImageProxy) GetImage ¶
func (proxy *ImageProxy) GetImage(w http.ResponseWriter, r *http.Request, imageURL string)
GetImage takes an HTTP request for an image and requests that image using the image proxy.
func (*ImageProxy) GetProxiedImageURL ¶
func (proxy *ImageProxy) GetProxiedImageURL(imageURL string) string
GetProxiedImageURL takes the URL of an image and returns a URL that can be used to view that image through the image proxy.
func (*ImageProxy) GetUnproxiedImageURL ¶
func (proxy *ImageProxy) GetUnproxiedImageURL(proxiedURL string) string
GetUnproxiedImageURL takes the URL of an image on the image proxy and returns the original URL of the image.
func (*ImageProxy) OnConfigChange ¶
func (proxy *ImageProxy) OnConfigChange(oldConfig, newConfig *model.Config)
type ImageProxyBackend ¶
type ImageProxyBackend interface { // GetImage provides a proxied image in response to an HTTP request. GetImage(w http.ResponseWriter, r *http.Request, imageURL string) // GetProxiedImageURL returns the URL to access a given image through the image proxy, whether the image proxy is // running externally or as part of the Mattermost server itself. GetProxiedImageURL(imageURL string) string // GetUnproxiedImageURL returns the original URL of an image from one that has been directed at the image proxy. GetUnproxiedImageURL(proxiedURL string) string }
An ImageProxyBackend provides the functionality for different types of image proxies. An ImageProxy will construct the required backend depending on the ImageProxySettings provided by the ConfigService.
type LocalBackend ¶
type LocalBackend struct {
// contains filtered or unexported fields
}
func (*LocalBackend) GetImage ¶
func (backend *LocalBackend) GetImage(w http.ResponseWriter, r *http.Request, imageURL string)
func (*LocalBackend) GetProxiedImageURL ¶
func (backend *LocalBackend) GetProxiedImageURL(imageURL string) string
func (*LocalBackend) GetUnproxiedImageURL ¶
func (backend *LocalBackend) GetUnproxiedImageURL(proxiedURL string) string