server

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RespWithSuccess

func RespWithSuccess(c *gin.Context, respBody interface{})

func ThrowReqError

func ThrowReqError(c *gin.Context, errorMsg string, userErr error, statusCode int)

Types

type Endpoints

type Endpoints struct {
	*VerificationEndpoint
}

Endpoints is responsible for handling all REST requests related to the service

func NewEndpoints

func NewEndpoints(verificationEndpoint *VerificationEndpoint) *Endpoints

func (*Endpoints) GetGuildUsers

func (e *Endpoints) GetGuildUsers(c *gin.Context, guildIdent api.GuildIdent)

(GET /v1/guilds/{guild_ident}/users)

func (*Endpoints) GetPlatformUser

func (e *Endpoints) GetPlatformUser(c *gin.Context, platformId api.PlatformId, platformUserId api.PlatformUserId, params api.GetPlatformUserParams)

(GET /v1/platform/{platform_id}/users/{platform_user_id})

func (*Endpoints) GetPlatformUserAPIKeyName

func (e *Endpoints) GetPlatformUserAPIKeyName(c *gin.Context, platformId api.PlatformId, platformUserId api.PlatformUserId, params api.GetPlatformUserAPIKeyNameParams)

(GET /v1/platform/{platform_id}/users/{platform_user_id}/apikey/name)

func (*Endpoints) GetPlatformUserUpdates

func (e *Endpoints) GetPlatformUserUpdates(c *gin.Context, platformId api.PlatformId, params api.GetPlatformUserUpdatesParams)

(GET /v1/platform/{platform_id}/users/updates)

func (*Endpoints) GetServiceProperties

func (e *Endpoints) GetServiceProperties(c *gin.Context, serviceUuid api.ServiceUuid)

(GET /v1/services/{service_uuid}/properties)

func (*Endpoints) GetServiceSubjectProperties

func (e *Endpoints) GetServiceSubjectProperties(c *gin.Context, serviceUuid api.ServiceUuid, subject api.Subject)

(GET /v1/services/{service_uuid}/properties/{subject})

func (*Endpoints) GetServiceSubjectProperty

func (e *Endpoints) GetServiceSubjectProperty(c *gin.Context, serviceUuid api.ServiceUuid, subject api.Subject, propertyName api.PropertyName)

(GET /v1/services/{service_uuid}/properties/{subject}/{property_name})

func (*Endpoints) GetV1Configuration

func (e *Endpoints) GetV1Configuration(c *gin.Context, params api.GetV1ConfigurationParams)

GetV1Configuration is the handler for GET /v1/configuration Get a configuration containing relevant information for running a service bot

func (*Endpoints) PostChannelPlatformStatistics

func (e *Endpoints) PostChannelPlatformStatistics(c *gin.Context, platformId api.PlatformId, channel string, params api.PostChannelPlatformStatisticsParams)

(POST /v1/channels/{platform_id}/{channel}/statistics)

func (*Endpoints) PostPlatformUserRefresh

func (e *Endpoints) PostPlatformUserRefresh(c *gin.Context, platformId api.PlatformId, platformUserId api.PlatformUserId)

(POST /v1/platform/{platform_id}/users/{platform_user_id}/refresh)

func (*Endpoints) PutPlatformUserAPIKey

func (e *Endpoints) PutPlatformUserAPIKey(c *gin.Context, platformId api.PlatformId, platformUserId api.PlatformUserId, params api.PutPlatformUserAPIKeyParams)

(PUT /v1/platform/{platform_id}/users/{platform_user_id}/apikey)

func (*Endpoints) PutPlatformUserBan

func (e *Endpoints) PutPlatformUserBan(c *gin.Context, platformId api.PlatformId, platformUserId api.PlatformUserId)

(PUT /v1/platform/{platform_id}/users/{platform_user_id}/ban)

func (*Endpoints) PutServiceSubjectProperties

func (e *Endpoints) PutServiceSubjectProperties(c *gin.Context, serviceUuid api.ServiceUuid, subject api.Subject)

(PUT /v1/services/{service_uuid}/properties/{subject})

func (*Endpoints) PutServiceSubjectProperty

func (e *Endpoints) PutServiceSubjectProperty(c *gin.Context, serviceUuid api.ServiceUuid, subject api.Subject, propertyName api.PropertyName)

(PUT /v1/services/{service_uuid}/properties/{subject}/{property_name})

type RESTServer

type RESTServer struct {
	// contains filtered or unexported fields
}

func NewRESTServer

func NewRESTServer(endpoints *Endpoints) *RESTServer

NewRESTServer returns a RESTServer instance configured to provide serve the verification REST API

func (*RESTServer) Start

func (s *RESTServer) Start()

Start launches the HTTP server Note: this method will block the calling goroutine indefinitely unless an error happens.

type Service

type Service struct {
	Uuid   string
	Name   string
	ApiKey string
}

type TokenMiddleware

type TokenMiddleware struct {
	// contains filtered or unexported fields
}

func NewTokenMiddleware

func NewTokenMiddleware() *TokenMiddleware

NewTokenMiddleware returns a new instance of the TokenMiddleware handler

func (*TokenMiddleware) OpenapiAuthenticator

func (m *TokenMiddleware) OpenapiAuthenticator(c context.Context, input *openapi3filter.AuthenticationInput) error

TokenRequestValidator validates that the Token provided in the request Authorization header is valid

func (*TokenMiddleware) TokenRequestValidator

func (m *TokenMiddleware) TokenRequestValidator(c *gin.Context)

TokenRequestValidator validates that the Token provided in the request Authorization header is valid

type VerificationEndpoint

type VerificationEndpoint struct {
	// contains filtered or unexported fields
}

func NewVerificationEndpoint

func NewVerificationEndpoint(verification *verify.Verification, worlds *verify.Worlds, statistics *history.Statistics, eventEmitter *verify.EventEmitter, syncher *sync.Service, banService *verify.BanService) *VerificationEndpoint

func (*VerificationEndpoint) GetVerificationPlatformUserStatus

func (e *VerificationEndpoint) GetVerificationPlatformUserStatus(c *gin.Context, platformId api.PlatformId, platformUserId api.PlatformUserId, params api.GetVerificationPlatformUserStatusParams)

(GET /v1/verification/platform/{platform_id}/users/{platform_user_id})

func (*VerificationEndpoint) GetVerificationPlatformUserUpdates

func (e *VerificationEndpoint) GetVerificationPlatformUserUpdates(c *gin.Context, platformId api.PlatformId, params api.GetVerificationPlatformUserUpdatesParams)

(GET /v1/verification/platform/{platform_id}/users/updates)

func (*VerificationEndpoint) PostVerificationPlatformUserRefresh

func (e *VerificationEndpoint) PostVerificationPlatformUserRefresh(c *gin.Context, platformId api.PlatformId, platformUserId api.PlatformUserId, params api.PostVerificationPlatformUserRefreshParams)

(POST /v1/verification/platform/{platform_id}/users/{platform_user_id}/refresh)

func (*VerificationEndpoint) PutVerificationPlatformUserTemporary

func (e *VerificationEndpoint) PutVerificationPlatformUserTemporary(c *gin.Context, platformId api.PlatformId, platformUserId api.PlatformUserId, params api.PutVerificationPlatformUserTemporaryParams)

(PUT /v1/verification/platform/{platform_id}/users/{platform_user_id}/temporary)

Jump to

Keyboard shortcuts

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