GoodMemGoodMem
ReferenceSdkV2Go

System

package goodmem // import "fury.io/pairsys/goodmem"

Server info + system initialization.

Methods are called as client.System().<Method>(ctx, ...) on a *goodmem.Client. Service: SystemService.

Index

type SystemService

type SystemService struct{ … }

Access this service as client.System() on a *goodmem.Client. Its methods follow.

func (s *SystemService) Info

func (s *SystemService) Info(ctx context.Context) (*models.SystemInfoResponse, error)

Returns the server's advertised semantic version, git metadata, build timestamp, and optional capability flags. The endpoint is intentionally unauthenticated so bootstrap tooling can call it before API keys exist.

HTTPGET /v1/system/info

Parameters

  • ctx (context.Context) — carries the deadline and cancellation signal for the call.

Returns(*models.SystemInfoResponse, error)

Example

info, err := client.System().Info(ctx)
if err != nil {
	log.Fatal(err)
}
_ = info.Version

func (s *SystemService) Init

func (s *SystemService) Init(ctx context.Context) (*models.SystemInitResponse, error)

Initializes the system by creating a root user and API key. This endpoint should only be called once during first-time setup. If the system is already initialized, the endpoint will return a success response without creating new credentials.

HTTPPOST /v1/system/init

Parameters

  • ctx (context.Context) — carries the deadline and cancellation signal for the call.

Returns(*models.SystemInitResponse, error)

Example

result, err := client.System().Init(ctx)
if err != nil {
	log.Fatal(err)
}
_ = result.AlreadyInitialized

type SystemInfoResponse

type SystemInfoResponse struct{ … }

  • Version (string, wire version) — Semantic version string advertised by the running server.
  • Major (int32, wire major) — Major version component parsed from the advertised semantic version.
  • Minor (int32, wire minor) — Minor version component parsed from the advertised semantic version.
  • Patch (int32, wire patch) — Patch version component parsed from the advertised semantic version.
  • Dirty (bool, wire dirty) — Whether the running build reports uncommitted workspace changes.
  • GitCommit (string, optional, wire gitCommit) — Git commit SHA baked into the build, when available.
  • GitDescribe (string, optional, wire gitDescribe) — Git describe output baked into the build, when available.
  • BuildTime (string, optional, wire buildTime) — Build timestamp recorded for this server binary, when available.
  • Capabilities (map[string]string, optional, wire capabilities) — Optional capability flags or metadata advertised by the running server.

type SystemInitResponse

type SystemInitResponse struct{ … }

Response from the system initialization endpoint.

  • AlreadyInitialized (bool, wire alreadyInitialized) — Indicates whether the system was already initialized before this request.
  • Message (string, wire message) — A human-readable message about the initialization status.
  • RootAPIKey (string, optional, wire rootApiKey) — The API key for the root user. Only present if system was just initialized (not previously initialized).
  • UserID (string, optional, wire userId) — The user ID of the root user. Only present if system was just initialized (not previously initialized).