routing

package
v0.0.0-...-9835270 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: AGPL-3.0, Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(
	apiMux *mux.Router,
	cfg *config.Dendrite,
	cacheIn service.Cache,
	feddomains *common.FedDomains,
	repo *repos.DownloadStateRepo,
	rpcCli *common.RpcClient,
	consumer *download.DownloadConsumer,
	idg *uid.UidGenerator,
)

Types

type CombineReader

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

func (*CombineReader) Read

func (r *CombineReader) Read(p []byte) (n int, err error)

type ForwardRequest

type ForwardRequest struct {
	Type         string `json:"type"`
	Content      string `json:"content"`
	From         string `json:"from"`
	SrcNetdiskID string `json:"srcNetdiskID"`
	SrcRoom      string `json:"srcRoom"`   // 留给大数据用
	SrcPeople    string `json:"srcPeople"` // 留给大数据用
	Public       bool   `json:"public"`    // 只有forward用到
	Traceable    bool   `json:"traceable"`
}

type MultiForwardPublicRequest

type MultiForwardPublicRequest struct {
	Fcid          string   `json:"fcid"`
	SrcNetdiskIDs []string `json:"srcNetdiskIDs"`
}

type MultiForwardRequest

type MultiForwardRequest struct {
	Type         string      `json:"type"`
	Content      string      `json:"content"`
	From         string      `json:"from"`
	TargetRooms  []string    `json:"target_rooms"`
	TargetUsers  []string    `json:"target_users"`
	SrcNetdiskID string      `json:"srcNetdiskID"`
	SrcRoom      string      `json:"srcRoom"`   // 留给大数据用
	SrcPeople    string      `json:"srcPeople"` // 留给大数据用
	Public       bool        `json:"public"`
	Traceable    bool        `json:"traceable"`
	SecurityWall interface{} `json:"securityWall"`
}

type Processor

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

func NewProcessor

func NewProcessor(
	cfg *config.Dendrite,
	histogram mon.LabeledHistogram,
	repo *repos.DownloadStateRepo,
	rpcCli *common.RpcClient,
	consumer *download.DownloadConsumer,
	idg *uid.UidGenerator,
	mediaURI []string,
) *Processor

func (*Processor) BuildBaseURL

func (p *Processor) BuildBaseURL(host string, urlPath ...string) string

func (*Processor) CheckEmote

func (p *Processor) CheckEmote(rw http.ResponseWriter, req *http.Request, device *authtypes.Device)

func (*Processor) Download

func (p *Processor) Download(rw http.ResponseWriter, req *http.Request, device *authtypes.Device)

/download/{serverName}/{mediaId}

func (*Processor) Favorite

func (p *Processor) Favorite(rw http.ResponseWriter, req *http.Request, device *authtypes.Device)

func (*Processor) FavoriteEmote

func (p *Processor) FavoriteEmote(rw http.ResponseWriter, req *http.Request, device *authtypes.Device)

func (*Processor) FavoriteFileEmote

func (p *Processor) FavoriteFileEmote(rw http.ResponseWriter, req *http.Request, device *authtypes.Device)

func (*Processor) FedDownload

func (p *Processor) FedDownload(rw http.ResponseWriter, req *http.Request)

func (*Processor) FedThumbnail

func (p *Processor) FedThumbnail(rw http.ResponseWriter, req *http.Request)

func (*Processor) ListEmote

func (p *Processor) ListEmote(rw http.ResponseWriter, req *http.Request, device *authtypes.Device)

func (*Processor) MultiForward

func (p *Processor) MultiForward(rw http.ResponseWriter, req *http.Request, device *authtypes.Device)

func (*Processor) MultiResForward

func (p *Processor) MultiResForward(rw http.ResponseWriter, req *http.Request, device *authtypes.Device)

func (*Processor) SingleForward

func (p *Processor) SingleForward(rw http.ResponseWriter, req *http.Request, device *authtypes.Device)

func (*Processor) Thumbnail

func (p *Processor) Thumbnail(rw http.ResponseWriter, req *http.Request, device *authtypes.Device)

/thumbnail/{serverName}/{mediaId}

func (*Processor) Unfavorite

func (p *Processor) Unfavorite(rw http.ResponseWriter, req *http.Request, device *authtypes.Device)

func (*Processor) Upload

func (p *Processor) Upload(rw http.ResponseWriter, req *http.Request, device *authtypes.Device)

/upload

func (*Processor) WaitEmote

func (p *Processor) WaitEmote(rw http.ResponseWriter, req *http.Request, device *authtypes.Device)

func (*Processor) WriteHeader

func (p *Processor) WriteHeader(resp *http.Response, w http.ResponseWriter)

Jump to

Keyboard shortcuts

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