Help us shape the future of Go! Take the 2026 Go Developer Survey

publish

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

Package publish hands a built mod to a provider: hyperline.gg, an archive players unpack and run, or a GitHub release that holds the archive.

Index

Constants

View Source
const DefaultOrigin = "https://hyperline.gg"

DefaultOrigin is the service modlock publish uses by default.

Variables

View Source
var (
	ReviewState_name = map[int32]string{
		0: "REVIEW_STATE_UNKNOWN",
		1: "REVIEW_STATE_PENDING",
		2: "REVIEW_STATE_APPROVED",
		3: "REVIEW_STATE_REJECTED",
	}
	ReviewState_value = map[string]int32{
		"REVIEW_STATE_UNKNOWN":  0,
		"REVIEW_STATE_PENDING":  1,
		"REVIEW_STATE_APPROVED": 2,
		"REVIEW_STATE_REJECTED": 3,
	}
)

Enum value maps for ReviewState.

Functions

func Archive

func Archive(ctx context.Context, mod *Mod, version, dir string) (string, error)

Archive writes a zip players unpack and run on Windows: Play.cmd, the command line of release version, and mod under mod/, in one folder named for the mod. It returns the archive's path in dir.

func GitHub

func GitHub(ctx context.Context, dir, tag, archive, notes string, output io.Writer) error

GitHub attaches archive to the release tagged tag in the GitHub repository of the project in dir, creating the release with notes when it does not exist. It runs the gh command line, which holds the creator's GitHub sign-in.

func WindowsCommand

func WindowsCommand(ctx context.Context, version string) (string, error)

WindowsCommand returns the Windows command line of release version: this executable on Windows, or the release's copy, downloaded into the user cache the first time.

Types

type Account added in v0.1.8

type Account struct {

	// DisplayName is the player's name.
	DisplayName string `protobuf:"bytes,4,opt,name=display_name,json=displayName,proto3" json:"displayName,omitempty"`
	// SteamId64 is the player's Steam account.
	SteamId64 uint64 `protobuf:"varint,6,opt,name=steam_id64,json=steamId64,proto3" json:"steamId64,omitempty"`
	// contains filtered or unexported fields
}

Account names the signed-in player.

func (*Account) CloneMessageVT added in v0.1.8

func (m *Account) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Account) CloneVT added in v0.1.8

func (m *Account) CloneVT() *Account

func (*Account) EqualMessageVT added in v0.1.8

func (this *Account) EqualMessageVT(thatMsg any) bool

func (*Account) EqualVT added in v0.1.8

func (this *Account) EqualVT(that *Account) bool

func (*Account) GetDisplayName added in v0.1.8

func (x *Account) GetDisplayName() string

func (*Account) GetSteamId64 added in v0.1.8

func (x *Account) GetSteamId64() uint64

func (*Account) MarshalJSON added in v0.1.8

func (x *Account) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Account to JSON.

func (*Account) MarshalProtoJSON added in v0.1.8

func (x *Account) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Account message to JSON.

func (*Account) MarshalProtoText added in v0.1.8

func (x *Account) MarshalProtoText() string

func (*Account) MarshalToSizedBufferVT added in v0.1.8

func (m *Account) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Account) MarshalToVT added in v0.1.8

func (m *Account) MarshalToVT(dAtA []byte) (int, error)

func (*Account) MarshalVT added in v0.1.8

func (m *Account) MarshalVT() (dAtA []byte, err error)

func (*Account) ProtoMessage added in v0.1.8

func (*Account) ProtoMessage()

func (*Account) Reset added in v0.1.8

func (x *Account) Reset()

func (*Account) SizeVT added in v0.1.8

func (m *Account) SizeVT() (n int)

func (*Account) String added in v0.1.8

func (x *Account) String() string

func (*Account) UnmarshalJSON added in v0.1.8

func (x *Account) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Account from JSON.

func (*Account) UnmarshalProtoJSON added in v0.1.8

func (x *Account) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Account message from JSON.

func (*Account) UnmarshalVT added in v0.1.8

func (m *Account) UnmarshalVT(dAtA []byte) error

type Error added in v0.1.8

type Error struct {

	// Code names the refusal for programs.
	Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
	// Message explains the refusal to the creator.
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

Error is a refused request's explanation.

func (*Error) CloneMessageVT added in v0.1.8

func (m *Error) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Error) CloneVT added in v0.1.8

func (m *Error) CloneVT() *Error

func (*Error) EqualMessageVT added in v0.1.8

func (this *Error) EqualMessageVT(thatMsg any) bool

func (*Error) EqualVT added in v0.1.8

func (this *Error) EqualVT(that *Error) bool

func (*Error) GetCode added in v0.1.8

func (x *Error) GetCode() string

func (*Error) GetMessage added in v0.1.8

func (x *Error) GetMessage() string

func (*Error) MarshalJSON added in v0.1.8

func (x *Error) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Error to JSON.

func (*Error) MarshalProtoJSON added in v0.1.8

func (x *Error) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Error message to JSON.

func (*Error) MarshalProtoText added in v0.1.8

func (x *Error) MarshalProtoText() string

func (*Error) MarshalToSizedBufferVT added in v0.1.8

func (m *Error) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Error) MarshalToVT added in v0.1.8

func (m *Error) MarshalToVT(dAtA []byte) (int, error)

func (*Error) MarshalVT added in v0.1.8

func (m *Error) MarshalVT() (dAtA []byte, err error)

func (*Error) ProtoMessage added in v0.1.8

func (*Error) ProtoMessage()

func (*Error) Reset added in v0.1.8

func (x *Error) Reset()

func (*Error) SizeVT added in v0.1.8

func (m *Error) SizeVT() (n int)

func (*Error) String added in v0.1.8

func (x *Error) String() string

func (*Error) UnmarshalJSON added in v0.1.8

func (x *Error) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Error from JSON.

func (*Error) UnmarshalProtoJSON added in v0.1.8

func (x *Error) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Error message from JSON.

func (*Error) UnmarshalVT added in v0.1.8

func (m *Error) UnmarshalVT(dAtA []byte) error

type Hyperline

type Hyperline struct {
	// Origin is the service, such as DefaultOrigin.
	Origin string
	// SessionFile holds the saved sign-in, readable only by the creator.
	SessionFile string
	// Output receives the sign-in instructions.
	Output io.Writer
}

Hyperline publishes to hyperline.gg or another service with its API.

func (*Hyperline) Publish

func (h *Hyperline) Publish(ctx context.Context, mod *Mod) (*Release, error)

Publish uploads mod with its notes and returns the release the service recorded. It signs in through the browser when no saved session is valid.

type Mod

type Mod struct {
	// Dir is the built mod's directory.
	Dir string
	// Manifest is its mod.json.
	Manifest *manifest.Manifest
	// Notes say what the release changed, for providers that show them.
	Notes string
}

Mod is a checked built mod.

func (*Mod) Files

func (m *Mod) Files() ([]string, error)

Files lists the files a release holds: the manifest, the entry, and the map files and client content the mod ships, if any. Other files in the directory, such as a session's log, stay out.

type Release added in v0.1.8

type Release struct {

	// Slug is the mod's slug.
	Slug string `protobuf:"bytes,1,opt,name=slug,proto3" json:"slug,omitempty"`
	// Version is the release's version.
	Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
	// Name is the mod's name.
	Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	// ReviewState is the release's review decision.
	ReviewState ReviewState `protobuf:"varint,10,opt,name=review_state,json=reviewState,proto3" json:"reviewState,omitempty"`
	// ReviewNote explains the decision.
	ReviewNote string `protobuf:"bytes,13,opt,name=review_note,json=reviewNote,proto3" json:"reviewNote,omitempty"`
	// contains filtered or unexported fields
}

Release is a published release as the service reports it.

func (*Release) CloneMessageVT added in v0.1.8

func (m *Release) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Release) CloneVT added in v0.1.8

func (m *Release) CloneVT() *Release

func (*Release) EqualMessageVT added in v0.1.8

func (this *Release) EqualMessageVT(thatMsg any) bool

func (*Release) EqualVT added in v0.1.8

func (this *Release) EqualVT(that *Release) bool

func (*Release) GetName added in v0.1.8

func (x *Release) GetName() string

func (*Release) GetReviewNote added in v0.1.8

func (x *Release) GetReviewNote() string

func (*Release) GetReviewState added in v0.1.8

func (x *Release) GetReviewState() ReviewState

func (*Release) GetSlug added in v0.1.8

func (x *Release) GetSlug() string

func (*Release) GetVersion added in v0.1.8

func (x *Release) GetVersion() string

func (*Release) MarshalJSON added in v0.1.8

func (x *Release) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Release to JSON.

func (*Release) MarshalProtoJSON added in v0.1.8

func (x *Release) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Release message to JSON.

func (*Release) MarshalProtoText added in v0.1.8

func (x *Release) MarshalProtoText() string

func (*Release) MarshalToSizedBufferVT added in v0.1.8

func (m *Release) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Release) MarshalToVT added in v0.1.8

func (m *Release) MarshalToVT(dAtA []byte) (int, error)

func (*Release) MarshalVT added in v0.1.8

func (m *Release) MarshalVT() (dAtA []byte, err error)

func (*Release) ProtoMessage added in v0.1.8

func (*Release) ProtoMessage()

func (*Release) Reset added in v0.1.8

func (x *Release) Reset()

func (*Release) SizeVT added in v0.1.8

func (m *Release) SizeVT() (n int)

func (*Release) String added in v0.1.8

func (x *Release) String() string

func (*Release) UnmarshalJSON added in v0.1.8

func (x *Release) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Release from JSON.

func (*Release) UnmarshalProtoJSON added in v0.1.8

func (x *Release) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Release message from JSON.

func (*Release) UnmarshalVT added in v0.1.8

func (m *Release) UnmarshalVT(dAtA []byte) error

type ReviewState added in v0.1.8

type ReviewState int32

ReviewState is a release's review decision.

const (
	// REVIEW_STATE_UNKNOWN awaits a decision, as PENDING does.
	ReviewState_REVIEW_STATE_UNKNOWN ReviewState = 0
	// REVIEW_STATE_PENDING awaits a person's decision.
	ReviewState_REVIEW_STATE_PENDING ReviewState = 1
	// REVIEW_STATE_APPROVED may be played.
	ReviewState_REVIEW_STATE_APPROVED ReviewState = 2
	// REVIEW_STATE_REJECTED was refused.
	ReviewState_REVIEW_STATE_REJECTED ReviewState = 3
)

func (ReviewState) Enum added in v0.1.8

func (x ReviewState) Enum() *ReviewState

func (ReviewState) MarshalJSON added in v0.1.8

func (x ReviewState) MarshalJSON() ([]byte, error)

MarshalJSON marshals the ReviewState to JSON.

func (ReviewState) MarshalProtoJSON added in v0.1.8

func (x ReviewState) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the ReviewState to JSON.

func (ReviewState) MarshalProtoText added in v0.1.8

func (x ReviewState) MarshalProtoText() string

func (ReviewState) MarshalText added in v0.1.8

func (x ReviewState) MarshalText() ([]byte, error)

MarshalText marshals the ReviewState to text.

func (ReviewState) String added in v0.1.8

func (x ReviewState) String() string

func (*ReviewState) UnmarshalJSON added in v0.1.8

func (x *ReviewState) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the ReviewState from JSON.

func (*ReviewState) UnmarshalProtoJSON added in v0.1.8

func (x *ReviewState) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the ReviewState from JSON.

func (*ReviewState) UnmarshalText added in v0.1.8

func (x *ReviewState) UnmarshalText(b []byte) error

UnmarshalText unmarshals the ReviewState from text.

type Session added in v0.1.8

type Session struct {

	// Origin is the service that issued the session.
	Origin string `protobuf:"bytes,1,opt,name=origin,proto3" json:"origin,omitempty"`
	// Token is the bearer credential.
	Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"`
	// ExpiresAt is the session's expiry in Unix milliseconds.
	ExpiresAt int64 `protobuf:"varint,3,opt,name=expires_at,json=expiresAt,proto3" json:"expiresAt,omitempty"`
	// Name is the signed-in player's name.
	Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

Session is the saved sign-in for one service origin.

func (*Session) CloneMessageVT added in v0.1.8

func (m *Session) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Session) CloneVT added in v0.1.8

func (m *Session) CloneVT() *Session

func (*Session) EqualMessageVT added in v0.1.8

func (this *Session) EqualMessageVT(thatMsg any) bool

func (*Session) EqualVT added in v0.1.8

func (this *Session) EqualVT(that *Session) bool

func (*Session) GetExpiresAt added in v0.1.8

func (x *Session) GetExpiresAt() int64

func (*Session) GetName added in v0.1.8

func (x *Session) GetName() string

func (*Session) GetOrigin added in v0.1.8

func (x *Session) GetOrigin() string

func (*Session) GetToken added in v0.1.8

func (x *Session) GetToken() string

func (*Session) MarshalJSON added in v0.1.8

func (x *Session) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Session to JSON.

func (*Session) MarshalProtoJSON added in v0.1.8

func (x *Session) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Session message to JSON.

func (*Session) MarshalProtoText added in v0.1.8

func (x *Session) MarshalProtoText() string

func (*Session) MarshalToSizedBufferVT added in v0.1.8

func (m *Session) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Session) MarshalToVT added in v0.1.8

func (m *Session) MarshalToVT(dAtA []byte) (int, error)

func (*Session) MarshalVT added in v0.1.8

func (m *Session) MarshalVT() (dAtA []byte, err error)

func (*Session) ProtoMessage added in v0.1.8

func (*Session) ProtoMessage()

func (*Session) Reset added in v0.1.8

func (x *Session) Reset()

func (*Session) SizeVT added in v0.1.8

func (m *Session) SizeVT() (n int)

func (*Session) String added in v0.1.8

func (x *Session) String() string

func (*Session) UnmarshalJSON added in v0.1.8

func (x *Session) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Session from JSON.

func (*Session) UnmarshalProtoJSON added in v0.1.8

func (x *Session) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Session message from JSON.

func (*Session) UnmarshalVT added in v0.1.8

func (m *Session) UnmarshalVT(dAtA []byte) error

type SignInExchange added in v0.1.8

type SignInExchange struct {

	// Code is the one-use code from the browser.
	Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
	// Verifier is the secret whose hash the sign-in page received.
	Verifier string `protobuf:"bytes,2,opt,name=verifier,proto3" json:"verifier,omitempty"`
	// contains filtered or unexported fields
}

SignInExchange trades the one-use code the browser handed back, with the verifier that proves this command line started the sign-in, for a session.

func (*SignInExchange) CloneMessageVT added in v0.1.8

func (m *SignInExchange) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SignInExchange) CloneVT added in v0.1.8

func (m *SignInExchange) CloneVT() *SignInExchange

func (*SignInExchange) EqualMessageVT added in v0.1.8

func (this *SignInExchange) EqualMessageVT(thatMsg any) bool

func (*SignInExchange) EqualVT added in v0.1.8

func (this *SignInExchange) EqualVT(that *SignInExchange) bool

func (*SignInExchange) GetCode added in v0.1.8

func (x *SignInExchange) GetCode() string

func (*SignInExchange) GetVerifier added in v0.1.8

func (x *SignInExchange) GetVerifier() string

func (*SignInExchange) MarshalJSON added in v0.1.8

func (x *SignInExchange) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SignInExchange to JSON.

func (*SignInExchange) MarshalProtoJSON added in v0.1.8

func (x *SignInExchange) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SignInExchange message to JSON.

func (*SignInExchange) MarshalProtoText added in v0.1.8

func (x *SignInExchange) MarshalProtoText() string

func (*SignInExchange) MarshalToSizedBufferVT added in v0.1.8

func (m *SignInExchange) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SignInExchange) MarshalToVT added in v0.1.8

func (m *SignInExchange) MarshalToVT(dAtA []byte) (int, error)

func (*SignInExchange) MarshalVT added in v0.1.8

func (m *SignInExchange) MarshalVT() (dAtA []byte, err error)

func (*SignInExchange) ProtoMessage added in v0.1.8

func (*SignInExchange) ProtoMessage()

func (*SignInExchange) Reset added in v0.1.8

func (x *SignInExchange) Reset()

func (*SignInExchange) SizeVT added in v0.1.8

func (m *SignInExchange) SizeVT() (n int)

func (*SignInExchange) String added in v0.1.8

func (x *SignInExchange) String() string

func (*SignInExchange) UnmarshalJSON added in v0.1.8

func (x *SignInExchange) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SignInExchange from JSON.

func (*SignInExchange) UnmarshalProtoJSON added in v0.1.8

func (x *SignInExchange) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SignInExchange message from JSON.

func (*SignInExchange) UnmarshalVT added in v0.1.8

func (m *SignInExchange) UnmarshalVT(dAtA []byte) error

type SignedIn added in v0.1.8

type SignedIn struct {

	// Token is the bearer credential.
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	// ExpiresAt is the session's expiry in Unix milliseconds.
	ExpiresAt int64 `protobuf:"varint,2,opt,name=expires_at,json=expiresAt,proto3" json:"expiresAt,omitempty"`
	// Account is the signed-in account.
	Account *Account `protobuf:"bytes,3,opt,name=account,proto3" json:"account,omitempty"`
	// contains filtered or unexported fields
}

SignedIn is the session the exchange returns.

func (*SignedIn) CloneMessageVT added in v0.1.8

func (m *SignedIn) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SignedIn) CloneVT added in v0.1.8

func (m *SignedIn) CloneVT() *SignedIn

func (*SignedIn) EqualMessageVT added in v0.1.8

func (this *SignedIn) EqualMessageVT(thatMsg any) bool

func (*SignedIn) EqualVT added in v0.1.8

func (this *SignedIn) EqualVT(that *SignedIn) bool

func (*SignedIn) GetAccount added in v0.1.8

func (x *SignedIn) GetAccount() *Account

func (*SignedIn) GetExpiresAt added in v0.1.8

func (x *SignedIn) GetExpiresAt() int64

func (*SignedIn) GetToken added in v0.1.8

func (x *SignedIn) GetToken() string

func (*SignedIn) MarshalJSON added in v0.1.8

func (x *SignedIn) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SignedIn to JSON.

func (*SignedIn) MarshalProtoJSON added in v0.1.8

func (x *SignedIn) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SignedIn message to JSON.

func (*SignedIn) MarshalProtoText added in v0.1.8

func (x *SignedIn) MarshalProtoText() string

func (*SignedIn) MarshalToSizedBufferVT added in v0.1.8

func (m *SignedIn) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SignedIn) MarshalToVT added in v0.1.8

func (m *SignedIn) MarshalToVT(dAtA []byte) (int, error)

func (*SignedIn) MarshalVT added in v0.1.8

func (m *SignedIn) MarshalVT() (dAtA []byte, err error)

func (*SignedIn) ProtoMessage added in v0.1.8

func (*SignedIn) ProtoMessage()

func (*SignedIn) Reset added in v0.1.8

func (x *SignedIn) Reset()

func (*SignedIn) SizeVT added in v0.1.8

func (m *SignedIn) SizeVT() (n int)

func (*SignedIn) String added in v0.1.8

func (x *SignedIn) String() string

func (*SignedIn) UnmarshalJSON added in v0.1.8

func (x *SignedIn) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SignedIn from JSON.

func (*SignedIn) UnmarshalProtoJSON added in v0.1.8

func (x *SignedIn) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SignedIn message from JSON.

func (*SignedIn) UnmarshalVT added in v0.1.8

func (m *SignedIn) UnmarshalVT(dAtA []byte) error

Jump to

Keyboard shortcuts

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