Documentation ¶
Index ¶
- Constants
- Variables
- func ItchfsURL(buildID int64, fileID int64, apiKey string) string
- func ParseAPIResponse(dst interface{}, res *http.Response) error
- type BuildEvent
- type BuildEventData
- type BuildEventType
- type BuildFileInfo
- type BuildFileState
- type BuildFileSubType
- type BuildFileType
- type BuildInfo
- type BuildState
- type ChannelInfo
- type Client
- func (c *Client) CreateBuild(target string, channel string, userVersion string) (r NewBuildResponse, err error)
- func (c *Client) CreateBuildEvent(buildID int64, eventType BuildEventType, message string, data BuildEventData) (r NewBuildEventResponse, err error)
- func (c *Client) CreateBuildFailure(buildID int64, message string, fatal bool) (r CreateBuildFailureResponse, err error)
- func (c *Client) CreateBuildFile(buildID int64, fileType BuildFileType, subType BuildFileSubType, ...) (r NewBuildFileResponse, err error)
- func (c *Client) CreateRediffBuildFailure(buildID int64, message string) (r CreateBuildFailureResponse, err error)
- func (c *Client) Do(req *http.Request) (*http.Response, error)
- func (c *Client) DownloadBuildFile(buildID int64, fileID int64) (reader io.ReadCloser, err error)
- func (c *Client) DownloadUploadBuild(uploadID int64, buildID int64) (r DownloadUploadBuildResponse, err error)
- func (c *Client) DownloadUploadBuildWithKey(downloadKey string, uploadID int64, buildID int64) (r DownloadUploadBuildResponse, err error)
- func (c *Client) DownloadUploadBuildWithKeyAndValues(downloadKey string, uploadID int64, buildID int64, values url.Values) (r DownloadUploadBuildResponse, err error)
- func (c *Client) FinalizeBuildFile(buildID int64, fileID int64, size int64) (r FinalizeBuildFileResponse, err error)
- func (c *Client) GameUploads(gameID int64) (r GameUploadsResponse, err error)
- func (c *Client) Get(url string) (*http.Response, error)
- func (c *Client) GetBuildFileDownloadURL(buildID int64, fileID int64) (r DownloadBuildFileResponse, err error)
- func (c *Client) GetBuildFileDownloadURLWithValues(buildID int64, fileID int64, values url.Values) (r DownloadBuildFileResponse, err error)
- func (c *Client) GetChannel(target string, channel string) (r GetChannelResponse, err error)
- func (c *Client) ListBuildEvents(buildID int64) (r ListBuildEventsResponse, err error)
- func (c *Client) ListBuildFiles(buildID int64) (r ListBuildFilesResponse, err error)
- func (c *Client) ListChannels(target string) (r ListChannelsResponse, err error)
- func (c *Client) MakePath(format string, a ...interface{}) string
- func (c *Client) MyGames() (r MyGamesResponse, err error)
- func (c *Client) PostForm(url string, data url.Values) (*http.Response, error)
- func (c *Client) SetServer(itchioServer string) *Client
- func (c *Client) UploadDownload(uploadID int64) (r UploadDownloadResponse, err error)
- func (c *Client) UploadDownloadWithKey(downloadKey string, uploadID int64) (r UploadDownloadResponse, err error)
- func (c *Client) UploadDownloadWithKeyAndValues(downloadKey string, uploadID int64, values url.Values) (r UploadDownloadResponse, err error)
- func (c *Client) WharfStatus() (r StatusResponse, err error)
- type CreateBuildFailureResponse
- type DownloadBuildFileResponse
- type DownloadUploadBuildResponse
- type DownloadUploadBuildResponseItem
- type FinalizeBuildFileResponse
- type Game
- type GameUploadsResponse
- type GetChannelResponse
- type ListBuildEventsResponse
- type ListBuildFilesResponse
- type ListChannelsResponse
- type MyGamesResponse
- type NewBuildEventResponse
- type NewBuildFileResponse
- type NewBuildResponse
- type Response
- type Spec
- type StatusResponse
- type Upload
- type UploadDownloadResponse
- type UploadType
- type User
Constants ¶
View Source
const ( BuildFileType_PATCH BuildFileType = "patch" BuildFileType_ARCHIVE = "archive" BuildFileType_SIGNATURE = "signature" BuildFileType_MANIFEST = "manifest" )
View Source
const ( BuildFileSubType_DEFAULT BuildFileSubType = "default" BuildFileSubType_GZIP = "gzip" BuildFileSubType_OPTIMIZED = "optimized" )
View Source
const ( UploadType_MULTIPART UploadType = "multipart" UploadType_RESUMABLE = "resumable" UploadType_DEFERRED_RESUMABLE = "deferred_resumable" )
View Source
const ( BuildState_STARTED BuildState = "started" BuildState_PROCESSING = "processing" BuildState_COMPLETED = "completed" BuildState_FAILED = "failed" )
View Source
const ( BuildFileState_CREATED BuildFileState = "created" BuildFileState_UPLOADING = "uploading" BuildFileState_UPLOADED = "uploaded" BuildFileState_FAILED = "failed" )
Variables ¶
View Source
var (
BuildFileNotFound = errors.New("build file not found in storage")
)
Functions ¶
func ItchfsURL ¶
ItchfsURL returns the itchfs:/// url usable to download a given file from a given build
func ParseAPIResponse ¶
Types ¶
type BuildEvent ¶
type BuildEvent struct { Type BuildEventType Message string Data BuildEventData }
type BuildEventData ¶
type BuildEventData map[string]interface{}
type BuildFileInfo ¶
type BuildFileInfo struct { ID int64 Size int64 State BuildFileState Type BuildFileType `json:"type"` SubType BuildFileSubType `json:"sub_type"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` }
func FindBuildFile ¶
func FindBuildFile(fileType BuildFileType, files []*BuildFileInfo) *BuildFileInfo
FindBuildFile looks for an uploaded file of the right type in a list of file. Returns nil if it can't find one.
type BuildFileState ¶
type BuildFileState string
type BuildFileSubType ¶
type BuildFileSubType string
type BuildFileType ¶
type BuildFileType string
type BuildInfo ¶
type BuildInfo struct { ID int64 ParentBuildID int64 `json:"parent_build_id"` State BuildState Version int64 UserVersion string `json:"user_version"` Files []*BuildFileInfo User User CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` }
type BuildState ¶
type BuildState string
type ChannelInfo ¶
type Client ¶
type Client struct { Key string HTTPClient *http.Client BaseURL string RetryPatterns []time.Duration UserAgent string }
func ClientWithKey ¶
func (*Client) CreateBuild ¶
func (*Client) CreateBuildEvent ¶
func (c *Client) CreateBuildEvent(buildID int64, eventType BuildEventType, message string, data BuildEventData) (r NewBuildEventResponse, err error)
func (*Client) CreateBuildFailure ¶
func (*Client) CreateBuildFile ¶
func (c *Client) CreateBuildFile(buildID int64, fileType BuildFileType, subType BuildFileSubType, uploadType UploadType) (r NewBuildFileResponse, err error)
func (*Client) CreateRediffBuildFailure ¶
func (c *Client) CreateRediffBuildFailure(buildID int64, message string) (r CreateBuildFailureResponse, err error)
func (*Client) DownloadBuildFile ¶
func (*Client) DownloadUploadBuild ¶
func (c *Client) DownloadUploadBuild(uploadID int64, buildID int64) (r DownloadUploadBuildResponse, err error)
func (*Client) DownloadUploadBuildWithKey ¶
func (*Client) DownloadUploadBuildWithKeyAndValues ¶
func (*Client) FinalizeBuildFile ¶
func (*Client) GameUploads ¶
func (c *Client) GameUploads(gameID int64) (r GameUploadsResponse, err error)
func (*Client) GetBuildFileDownloadURL ¶
func (c *Client) GetBuildFileDownloadURL(buildID int64, fileID int64) (r DownloadBuildFileResponse, err error)
func (*Client) GetBuildFileDownloadURLWithValues ¶
func (*Client) GetChannel ¶
func (c *Client) GetChannel(target string, channel string) (r GetChannelResponse, err error)
func (*Client) ListBuildEvents ¶
func (c *Client) ListBuildEvents(buildID int64) (r ListBuildEventsResponse, err error)
func (*Client) ListBuildFiles ¶
func (c *Client) ListBuildFiles(buildID int64) (r ListBuildFilesResponse, err error)
func (*Client) ListChannels ¶
func (c *Client) ListChannels(target string) (r ListChannelsResponse, err error)
func (*Client) MyGames ¶
func (c *Client) MyGames() (r MyGamesResponse, err error)
func (*Client) UploadDownload ¶
func (c *Client) UploadDownload(uploadID int64) (r UploadDownloadResponse, err error)
func (*Client) UploadDownloadWithKey ¶
func (c *Client) UploadDownloadWithKey(downloadKey string, uploadID int64) (r UploadDownloadResponse, err error)
func (*Client) UploadDownloadWithKeyAndValues ¶
func (*Client) WharfStatus ¶
func (c *Client) WharfStatus() (r StatusResponse, err error)
type CreateBuildFailureResponse ¶
type CreateBuildFailureResponse struct {
Response
}
type DownloadUploadBuildResponse ¶
type DownloadUploadBuildResponse struct { Response Patch *DownloadUploadBuildResponseItem Signature *DownloadUploadBuildResponseItem Manifest *DownloadUploadBuildResponseItem Archive *DownloadUploadBuildResponseItem }
type DownloadUploadBuildResponseItem ¶
type DownloadUploadBuildResponseItem struct {
URL string
}
type FinalizeBuildFileResponse ¶
type FinalizeBuildFileResponse struct {
Response
}
type GameUploadsResponse ¶
type GetChannelResponse ¶
type GetChannelResponse struct { Response Channel ChannelInfo }
type ListBuildEventsResponse ¶
type ListBuildEventsResponse struct { Response Events []BuildEvent }
type ListBuildFilesResponse ¶
type ListBuildFilesResponse struct { Response Files []*BuildFileInfo }
type ListChannelsResponse ¶
type ListChannelsResponse struct { Response Channels map[string]ChannelInfo }
type MyGamesResponse ¶
type NewBuildEventResponse ¶
type NewBuildEventResponse struct {
Response
}
type NewBuildFileResponse ¶
type NewBuildResponse ¶
type Spec ¶
A Spec points to a given itch.io game, optionally to a specific channel
func ParseSpec ¶
ParseSpec parses something of the form `user/page:channel` and returns `user/page` and `channel` separately
func (*Spec) EnsureChannel ¶
EnsureChannel returns an error if this spec is missing a channel
type StatusResponse ¶
type UploadDownloadResponse ¶
type UploadType ¶
type UploadType string
Click to show internal directories.
Click to hide internal directories.