types

package
v0.1.0-94ccd12 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiKey

type ApiKey struct {
	Owner     string    `json:"owner"`
	OwnerType OwnerType `json:"owner_type"`
	Key       string    `json:"key"`
	Name      string    `json:"name"`
}

type BalanceTransfer

type BalanceTransfer struct {
	ID          string              `json:"id"`
	Created     time.Time           `json:"created"`
	Owner       string              `json:"owner"`
	OwnerType   OwnerType           `json:"owner_type"`
	PaymentType PaymentType         `json:"payment_type"`
	Amount      int                 `json:"amount"`
	Data        BalanceTransferData `json:"data"`
}

type BalanceTransferData

type BalanceTransferData struct {
	JobID           string `json:"job_id"`
	StripePaymentID string `json:"stripe_payment_id"`
}

type Job

type Job struct {
	ID        string    `json:"id"`
	Created   time.Time `json:"created"`
	Owner     string    `json:"owner"`
	OwnerType OwnerType `json:"owner_type"`
	State     string    `json:"state"`
	Status    string    `json:"status"`
	Data      JobData   `json:"data"`
}

type JobData

type JobData struct {
	Spec      JobSpec                `json:"spec"`
	Container data.JobOfferContainer `json:"container"`
}

type JobSpec

type JobSpec struct {
	Module string            `json:"module"`
	Inputs map[string]string `json:"inputs"`
}

type Module

type Module struct {
	ID       string `json:"id"`
	Title    string `json:"title"`
	Cost     int    `json:"cost"`
	Template string `json:"template"`
}

type OwnerType

type OwnerType string
const (
	OwnerTypeUser OwnerType = "user"
)

type PaymentType

type PaymentType string
const (
	PaymentTypeAdmin  PaymentType = "admin"
	PaymentTypeStripe PaymentType = "stripe"
	PaymentTypeJob    PaymentType = "job"
)

type RequestContext

type RequestContext struct {
	Ctx       context.Context
	Owner     string
	OwnerType OwnerType
}

passed between the api server and the controller

type UserStatus

type UserStatus struct {
	User    string `json:"user"`
	Credits int    `json:"credits"`
}

type WebsocketEvent

type WebsocketEvent struct {
	Type WebsocketEventType `json:"type"`
	Job  *Job               `json:"job"`
}

type WebsocketEventType

type WebsocketEventType string
const (
	WebsocketEventJobUpdate WebsocketEventType = "job"
)

Jump to

Keyboard shortcuts

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