mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 21:04:37 +03:00
Desktop integration (#2073)
* Open stash in system tray on Windows/MacOS * Add desktop notifications * MacOS Bundling * Add binary icon Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
e48b2ba3e8
commit
0e514183a7
37
vendor/github.com/go-chi/httplog/util.go
generated
vendored
Normal file
37
vendor/github.com/go-chi/httplog/util.go
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
package httplog
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io"
|
||||
)
|
||||
|
||||
// limitBuffer is used to pipe response body information from the
|
||||
// response writer to a certain limit amount. The idea is to read
|
||||
// a portion of the response body such as an error response so we
|
||||
// may log it.
|
||||
type limitBuffer struct {
|
||||
*bytes.Buffer
|
||||
limit int
|
||||
}
|
||||
|
||||
func newLimitBuffer(size int) io.ReadWriter {
|
||||
return limitBuffer{
|
||||
Buffer: bytes.NewBuffer(make([]byte, 0, size)),
|
||||
limit: size,
|
||||
}
|
||||
}
|
||||
|
||||
func (b limitBuffer) Write(p []byte) (n int, err error) {
|
||||
if b.Buffer.Len() >= b.limit {
|
||||
return len(p), nil
|
||||
}
|
||||
limit := b.limit
|
||||
if len(p) < limit {
|
||||
limit = len(p)
|
||||
}
|
||||
return b.Buffer.Write(p[:limit])
|
||||
}
|
||||
|
||||
func (b limitBuffer) Read(p []byte) (n int, err error) {
|
||||
return b.Buffer.Read(p)
|
||||
}
|
||||
Reference in New Issue
Block a user