-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Saw #1005 and thought it was a fun little challenge. Tested that this worked locally for: - Previewing with WebP (default) - Previewing with GIF (passing --gif flag) - Updating config using either format - Exporting image using either format Inspected the images shown and confirmed that it does generate a WebP or GIF file as appropriate, and that the src element is set to the appropriate image type.
- Loading branch information
1 parent
5439bb8
commit 01442a4
Showing
13 changed files
with
106 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,27 @@ | ||
package fanout | ||
|
||
const ( | ||
// EventTypeWebP is used to signal what type of message we are sending over | ||
// EventTypeImage is used to signal what type of message we are sending over | ||
// the socket. | ||
EventTypeWebP = "webp" | ||
EventTypeImage = "img" | ||
|
||
// EventTypeSchema is used to signal that the schema for a given app has | ||
// changed. | ||
EventTypeSchema = "schema" | ||
|
||
// EventTypeErr is used to signal there was an error encountered rendering | ||
// the WebP image. | ||
// the image. | ||
EventTypeErr = "error" | ||
) | ||
|
||
// WebsocketEvent is a structure used to send messages over the socket. | ||
type WebsocketEvent struct { | ||
// Message is the contents of the message. This is a webp, base64 encoded. | ||
// Message is the contents of the message. This is a webp or gif, base64 encoded. | ||
Message string `json:"message"` | ||
|
||
// ImageType indicates whether the Message is webp or gif image. | ||
ImageType string `json:"img_type"` | ||
|
||
// Type is the type of message we are sending over the socket. | ||
Type string `json:"type"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.