admin

package
v0.0.0-...-6a0c4c8 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = "admin"

ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.

Variables

View Source
var MethodNames = [2]string{"health", "upload backup"}

MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.

Functions

func MakeBadRequest

func MakeBadRequest(err error) *goa.ServiceError

MakeBadRequest builds a goa.ServiceError from an error.

func MakeForbidden

func MakeForbidden(err error) *goa.ServiceError

MakeForbidden builds a goa.ServiceError from an error.

func MakeNotFound

func MakeNotFound(err error) *goa.ServiceError

MakeNotFound builds a goa.ServiceError from an error.

func MakeUnauthorized

func MakeUnauthorized(err error) *goa.ServiceError

MakeUnauthorized builds a goa.ServiceError from an error.

func NewHealthEndpointEndpoint

func NewHealthEndpointEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint

NewHealthEndpointEndpoint returns an endpoint function that calls the method "health" of service "admin".

func NewUploadBackupEndpoint

func NewUploadBackupEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint

NewUploadBackupEndpoint returns an endpoint function that calls the method "upload backup" of service "admin".

func NewViewedBackupCheck

func NewViewedBackupCheck(res *BackupCheck, view string) *adminviews.BackupCheck

NewViewedBackupCheck initializes viewed result type BackupCheck from result type BackupCheck using the given view.

func NewViewedHealth

func NewViewedHealth(res *Health, view string) *adminviews.Health

NewViewedHealth initializes viewed result type Health from result type Health using the given view.

Types

type Auther

type Auther interface {
	// JWTAuth implements the authorization logic for the JWT security scheme.
	JWTAuth(ctx context.Context, token string, schema *security.JWTScheme) (context.Context, error)
}

Auther defines the authorization functions to be implemented by the service.

type BackupCheck

type BackupCheck struct {
	DeviceName   *string
	DeviceID     *string
	GenerationID *string
	Records      []int32
	Errors       []string
}

BackupCheck is the result type of the admin service upload backup method.

func NewBackupCheck

func NewBackupCheck(vres *adminviews.BackupCheck) *BackupCheck

NewBackupCheck initializes result type BackupCheck from viewed result type BackupCheck.

type Client

type Client struct {
	HealthEndpointEndpoint goa.Endpoint
	UploadBackupEndpoint   goa.Endpoint
}

Client is the "admin" service client.

func NewClient

func NewClient(healthEndpoint, uploadBackup goa.Endpoint) *Client

NewClient initializes a "admin" service client given the endpoints.

func (*Client) HealthEndpoint

func (c *Client) HealthEndpoint(ctx context.Context, p *HealthPayload) (res *Health, err error)

HealthEndpoint calls the "health" endpoint of the "admin" service.

func (*Client) UploadBackup

func (c *Client) UploadBackup(ctx context.Context, p *UploadBackupPayload, req io.ReadCloser) (res *BackupCheck, err error)

UploadBackup calls the "upload backup" endpoint of the "admin" service.

type Endpoints

type Endpoints struct {
	HealthEndpoint goa.Endpoint
	UploadBackup   goa.Endpoint
}

Endpoints wraps the "admin" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "admin" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint)

Use applies the given middleware to all the "admin" service endpoints.

type Health

type Health struct {
	Queue *QueueHealth
}

Health is the result type of the admin service health method.

func NewHealth

func NewHealth(vres *adminviews.Health) *Health

NewHealth initializes result type Health from viewed result type Health.

type HealthPayload

type HealthPayload struct {
	Auth string
}

HealthPayload is the payload type of the admin service health method.

type QueueHealth

type QueueHealth struct {
	Pending int64
	Errors  int64
}

type Service

type Service interface {
	// Health implements health.
	HealthEndpoint(context.Context, *HealthPayload) (res *Health, err error)
	// UploadBackup implements upload backup.
	UploadBackup(context.Context, *UploadBackupPayload, io.ReadCloser) (res *BackupCheck, err error)
}

Service is the admin service interface.

type UploadBackupPayload

type UploadBackupPayload struct {
	Auth          string
	ContentLength int64
	ContentType   string
}

UploadBackupPayload is the payload type of the admin service upload backup method.

type UploadBackupRequestData

type UploadBackupRequestData struct {
	// Payload is the method payload.
	Payload *UploadBackupPayload
	// Body streams the HTTP request body.
	Body io.ReadCloser
}

UploadBackupRequestData holds both the payload and the HTTP request body reader of the "upload backup" method.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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