mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-02-08 04:28:32 +00:00
api: Add NullImage
This commit is contained in:
parent
6dc189519c
commit
209e6282b0
|
@ -28,11 +28,14 @@ type Image struct {
|
|||
// ContentType is optional and will be automatically detected. However, it
|
||||
// should always return "image/jpeg," "image/png" or "image/gif".
|
||||
ContentType string
|
||||
|
||||
// Just raw content of the file.
|
||||
Content []byte
|
||||
}
|
||||
|
||||
// NullImage is an *Image value that marshals to a null value. Use this to unset
|
||||
// the image. It exists mostly for documentation purposes.
|
||||
var NullImage = &Image{}
|
||||
|
||||
func DecodeImage(data []byte) (*Image, error) {
|
||||
parts := bytes.SplitN(data, []byte{';'}, 2)
|
||||
if len(parts) < 2 {
|
||||
|
|
Loading…
Reference in a new issue