hub

package
v0.0.28 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Port    = "8082"
	RootUrl = "http://localhost:" + Port

	RegistrationPath = "/registration"
	LoginPath        = "/login"
	LogoutPath       = "/logout"
	AuthCheckPath    = "/auth-check"
	WipeDataPath     = "/wipe-data"

	UserPath           = "/user"
	DeleteUserPath     = UserPath + "/delete"
	ChangePasswordPath = UserPath + "/password"

	TagPath       = "/tags"
	TagUploadPath = TagPath + "/upload"
	TagDeletePath = TagPath + "/delete"
	GetTagsPath   = TagPath + "/get-tags"
	DownloadPath  = TagPath + "/" // TODO maybe add "download" to make it clearer?

	AppPath         = "/apps"
	AppCreationPath = AppPath + "/create"
	AppGetListPath  = AppPath + "/get-list"
	AppDeletePath   = AppPath + "/delete"
	SearchAppsPath  = AppPath + "/search"
)
View Source
var (
	SampleUser           = "myuser"
	SampleApp            = "myapp"
	SampleTag            = "v0.0.1"
	SampleTagFileContent = "hello"
	SampleEmail          = "testuser@example.com"
	SamplePassword       = "mypassword"
	SampleOrigin         = RootUrl
	SampleForm           = &RegistrationForm{
		SampleUser,
		SamplePassword,
		SampleEmail,
	}
)

Functions

This section is empty.

Types

type AppAndTag

type AppAndTag struct {
	App string `json:"app"`
	Tag string `json:"tag"`
}

type HubClient

type HubClient struct {
	Parent        utils.ComponentClient
	Email         string
	App           string
	Tag           string
	UploadContent []byte
}

func GetHub

func GetHub() *HubClient

func (*HubClient) ChangePassword added in v0.0.27

func (h *HubClient) ChangePassword() error

func (*HubClient) CheckAuth added in v0.0.27

func (h *HubClient) CheckAuth() error

func (*HubClient) CreateApp added in v0.0.27

func (h *HubClient) CreateApp() error

func (*HubClient) DeleteApp added in v0.0.27

func (h *HubClient) DeleteApp() error

func (*HubClient) DeleteTag added in v0.0.27

func (h *HubClient) DeleteTag() error

func (*HubClient) DeleteUser added in v0.0.27

func (h *HubClient) DeleteUser() error

func (*HubClient) DownloadTag added in v0.0.27

func (h *HubClient) DownloadTag() (string, error)

func (*HubClient) FindApps added in v0.0.27

func (h *HubClient) FindApps(searchTerm string) ([]UserAndApp, error)

func (*HubClient) GetApps

func (h *HubClient) GetApps() ([]string, error)

func (*HubClient) GetTags added in v0.0.27

func (h *HubClient) GetTags() ([]string, error)

func (*HubClient) Login added in v0.0.27

func (h *HubClient) Login() error

func (*HubClient) Logout added in v0.0.27

func (h *HubClient) Logout() error

func (*HubClient) RegisterUser added in v0.0.27

func (h *HubClient) RegisterUser() error

func (*HubClient) UploadTag added in v0.0.27

func (h *HubClient) UploadTag() error

func (*HubClient) WipeData added in v0.0.27

func (h *HubClient) WipeData() error

type LoginCredentials

type LoginCredentials struct {
	User     string `json:"user"`
	Password string `json:"password"`
	// TODO Couldn't I take the origin directly from the request? Seems unnecessary.
	Origin string `json:"origin"`
}

type RegistrationForm

type RegistrationForm struct {
	User     string `json:"user"`
	Password string `json:"password"`
	Email    string `json:"email"`
}

func GetRegistrationForm added in v0.0.27

func GetRegistrationForm(hub *HubClient) *RegistrationForm

type TagInfo

type TagInfo struct {
	User string `json:"user"`
	App  string `json:"app"`
	Tag  string `json:"tag"`
}

type TagUpload

type TagUpload struct {
	App     string `json:"app"`
	Tag     string `json:"tag"`
	Content []byte `json:"content"`
}

type UserAndApp

type UserAndApp struct {
	User string `json:"user"`
	App  string `json:"app"`
}

Jump to

Keyboard shortcuts

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