appinfo

package
v0.0.0-...-c32710b Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeGetAppInfoEndpoint

func MakeGetAppInfoEndpoint(s Service) endpoint.Endpoint

MakeGetAppInfoEndpoint returns an endpoint via the passed service. Primarily useful in a server.

Types

type AppInfo

type AppInfo struct {
	UserInfo    UserInfo    `json:"userInfo"`
	VersionInfo VersionInfo `json:"versionInfo"`
}

AppInfo provides information of the authenticated user and application meta-data swagger:model

type GetAppInfoRequest

type GetAppInfoRequest struct {
	User *security.User
}

GetAppInfoRequest combines the necessary parameters for a appinfo request

type GetAppInfoResponse

type GetAppInfoResponse struct {
	AppInfo AppInfo
	Err     error `json:"err,omitempty"`
}

GetAppInfoResponse is the appinfo response object

func (GetAppInfoResponse) Failed

func (r GetAppInfoResponse) Failed() error

Failed implements endpoint.Failer.

type Service

type Service interface {
	// GetAppInfo returns meta-data of the application and the currently loged-in user
	GetAppInfo(user *security.User) (ai AppInfo, err error)
}

Service defines the appinfo methods

func NewService

func NewService(logger logging.Logger, version, build string) Service

NewService returns a Service with all of the expected middlewares wired in.

type ServiceMiddleware

type ServiceMiddleware func(Service) Service

ServiceMiddleware describes a service (as opposed to endpoint) middleware. it is used to intercept the method execution and perform actions before/after the serivce method execution

func ServiceLoggingMiddleware

func ServiceLoggingMiddleware(logger logging.Logger) ServiceMiddleware

ServiceLoggingMiddleware takes a logger as a dependency and returns a ServiceLoggingMiddleware.

type UserInfo

type UserInfo struct {
	// DisplayName of authenticated user
	DisplayName string `json:"displayName"`
	// UserID of authenticated user
	UserID string `json:"userId"`
	// UserName of authenticated user
	UserName string `json:"userName"`
	// Email of authenticated user
	Email string `json:"email"`
	// Roles the authenticated user possesses
	Roles []string `json:"roles"`
}

UserInfo provides information about authenticated user

type VersionInfo

type VersionInfo struct {
	// Version of the application
	Version string `json:"version"`
	// BuildNumber defines the specific build
	BuildNumber string `json:"buildNumber"`
}

VersionInfo contains application meta-data

Jump to

Keyboard shortcuts

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