Documentation ¶
Overview ¶
Package juvuln provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen DO NOT EDIT.
Package juvuln provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen DO NOT EDIT.
Index ¶
- Constants
- func GetOpenAPIFile() ([]byte, error)
- func GetSwagger() (swagger *openapi3.Swagger, err error)
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- func UpdateProgramCache() error
- type BadGateway
- type ChiServerOptions
- type DomainPathParam
- type DomainQueryParam
- type Error
- type GetModuleAtRevisionParams
- type InternalServerError
- type LanguageParam
- type MiddlewareFunc
- type ModuleParam
- type NewSubscriber
- type NewSubscriberScheme
- type NotFound
- type ProgramCache
- type ProgramRevision
- type RestApi
- func (ra *RestApi) CheckWorker(w http.ResponseWriter, r *http.Request, id UuidParam)
- func (ra *RestApi) ForwardWebhook(w http.ResponseWriter, r *http.Request, dom DomainPathParam, id UuidParam)
- func (ra *RestApi) GetModuleAtRevision(w http.ResponseWriter, r *http.Request, p GetModuleAtRevisionParams)
- func (ra *RestApi) WorkerLoadUpdate(w http.ResponseWriter, r *http.Request, id UuidParam)
- func (ra *RestApi) WorkerSubscribe(w http.ResponseWriter, r *http.Request)
- func (ra *RestApi) WorkerUnsubscribe(w http.ResponseWriter, r *http.Request, id UuidParam)
- type RevisionParam
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) CheckWorker(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ForwardWebhook(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetModuleAtRevision(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) WorkerLoadUpdate(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) WorkerSubscribe(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) WorkerUnsubscribe(w http.ResponseWriter, r *http.Request)
- type SubscriberScheme
- type Unauthorized
- type UpdateLoad
- type UuidParam
- type Worker
- type WorkerLoadUpdateJSONRequestBody
- type WorkerSubscribeJSONBodyScheme
- type WorkerSubscribeJSONRequestBody
- type WorkerTask
Constants ¶
const (
BasicAuthScopes = "BasicAuth.Scopes"
)
Variables ¶
This section is empty.
Functions ¶
func GetSwagger ¶
GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.
func Handler ¶
func Handler(si ServerInterface) http.Handler
Handler creates http.Handler with routing matching OpenAPI spec.
func HandlerFromMux ¶
func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerFromMuxWithBaseURL ¶
func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler
func HandlerWithOptions ¶
func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
HandlerWithOptions creates http.Handler with additional options
func PathToRawSpec ¶
Constructs a synthetic filesystem for resolving external references when loading openapi specifications.
func UpdateProgramCache ¶
func UpdateProgramCache() error
Update the program listing by queries each DB for content
Types ¶
type ChiServerOptions ¶
type ChiServerOptions struct { BaseURL string BaseRouter chi.Router Middlewares []MiddlewareFunc }
type DomainPathParam ¶
type DomainPathParam string
DomainPathParam defines model for domainPathParam.
type DomainQueryParam ¶
type DomainQueryParam string
DomainQueryParam defines model for domainQueryParam.
type Error ¶
type Error struct { // Error code Code int `json:"code"` // Error message Message string `json:"message"` }
Error defines model for Error.
type GetModuleAtRevisionParams ¶
type GetModuleAtRevisionParams struct { // A domain Domain DomainQueryParam `json:"domain"` // The module name Module ModuleParam `json:"module"` // The language of the module Language LanguageParam `json:"language"` // The module revision. The keyword 'latest' will return the latest revision. Revision RevisionParam `json:"revision"` }
GetModuleAtRevisionParams defines parameters for GetModuleAtRevision.
type InternalServerError ¶
type InternalServerError Error
InternalServerError defines model for InternalServerError.
type MiddlewareFunc ¶
type MiddlewareFunc func(http.HandlerFunc) http.HandlerFunc
type NewSubscriber ¶
type NewSubscriber struct { // On the format [userinfo@]host[:port]. Authority string `json:"authority"` // A list of supported languages. Languages []string `json:"languages"` Scheme NewSubscriberScheme `json:"scheme"` Uuid string `json:"uuid"` }
NewSubscriber defines model for NewSubscriber.
type NewSubscriberScheme ¶
type NewSubscriberScheme SubscriberScheme
type ProgramCache ¶
func (*ProgramCache) Add ¶
func (p *ProgramCache) Add(obj *ProgramRevision)
func (*ProgramCache) Begin ¶
func (p *ProgramCache) Begin()
func (*ProgramCache) Commit ¶
func (p *ProgramCache) Commit()
func (*ProgramCache) GetModule ¶
func (p *ProgramCache) GetModule(domain, name string, revision int32) (*ProgramRevision, error)
type ProgramRevision ¶
type ProgramRevision struct { Domain string Name string ProgramUuid uuid.UUID Type string Schedule string Deadline int32 Language string Revision int32 Code []byte Checksum string // contains filtered or unexported fields }
func NewProgramRevision ¶
func (*ProgramRevision) Equals ¶
func (p *ProgramRevision) Equals(b *ProgramRevision) bool
func (*ProgramRevision) Execute ¶
func (p *ProgramRevision) Execute() error
func (*ProgramRevision) GetId ¶
func (p *ProgramRevision) GetId() string
func (*ProgramRevision) Run ¶ added in v0.1.2
func (p *ProgramRevision) Run()
func (*ProgramRevision) Start ¶
func (p *ProgramRevision) Start()
func (*ProgramRevision) Stop ¶
func (p *ProgramRevision) Stop()
type RestApi ¶
type RestApi struct{}
Main struct for the RestApi implementation
func (*RestApi) CheckWorker ¶
Check registration
func (*RestApi) ForwardWebhook ¶
func (ra *RestApi) ForwardWebhook(w http.ResponseWriter, r *http.Request, dom DomainPathParam, id UuidParam)
Forward a call to a webhook program
func (*RestApi) GetModuleAtRevision ¶
func (ra *RestApi) GetModuleAtRevision(w http.ResponseWriter, r *http.Request, p GetModuleAtRevisionParams)
Get the code for a program module
func (*RestApi) WorkerLoadUpdate ¶
Report the current load
func (*RestApi) WorkerSubscribe ¶
func (ra *RestApi) WorkerSubscribe(w http.ResponseWriter, r *http.Request)
Self registration subscription endpoint
func (*RestApi) WorkerUnsubscribe ¶
Self un-registration subscription endpoint
type ServerInterface ¶
type ServerInterface interface { // Get module // (GET /v1/library) GetModuleAtRevision(w http.ResponseWriter, r *http.Request, params GetModuleAtRevisionParams) // Subscribe as a worker. // (POST /v1/subscribers) WorkerSubscribe(w http.ResponseWriter, r *http.Request) // Unsubscribe as a worker // (DELETE /v1/subscribers/{uuid}) WorkerUnsubscribe(w http.ResponseWriter, r *http.Request, uuid UuidParam) // Check if subscriber has been added // (GET /v1/subscribers/{uuid}) CheckWorker(w http.ResponseWriter, r *http.Request, uuid UuidParam) // Update Load Data // (PUT /v1/subscribers/{uuid}/load) WorkerLoadUpdate(w http.ResponseWriter, r *http.Request, uuid UuidParam) // Proxy interface for webhooks // (POST /v1/webhooks/{domain}/{uuid}) ForwardWebhook(w http.ResponseWriter, r *http.Request, domain DomainPathParam, uuid UuidParam) }
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct { Handler ServerInterface HandlerMiddlewares []MiddlewareFunc }
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) CheckWorker ¶
func (siw *ServerInterfaceWrapper) CheckWorker(w http.ResponseWriter, r *http.Request)
CheckWorker operation middleware
func (*ServerInterfaceWrapper) ForwardWebhook ¶
func (siw *ServerInterfaceWrapper) ForwardWebhook(w http.ResponseWriter, r *http.Request)
ForwardWebhook operation middleware
func (*ServerInterfaceWrapper) GetModuleAtRevision ¶
func (siw *ServerInterfaceWrapper) GetModuleAtRevision(w http.ResponseWriter, r *http.Request)
GetModuleAtRevision operation middleware
func (*ServerInterfaceWrapper) WorkerLoadUpdate ¶
func (siw *ServerInterfaceWrapper) WorkerLoadUpdate(w http.ResponseWriter, r *http.Request)
WorkerLoadUpdate operation middleware
func (*ServerInterfaceWrapper) WorkerSubscribe ¶
func (siw *ServerInterfaceWrapper) WorkerSubscribe(w http.ResponseWriter, r *http.Request)
WorkerSubscribe operation middleware
func (*ServerInterfaceWrapper) WorkerUnsubscribe ¶
func (siw *ServerInterfaceWrapper) WorkerUnsubscribe(w http.ResponseWriter, r *http.Request)
WorkerUnsubscribe operation middleware
type SubscriberScheme ¶
type SubscriberScheme string
const ( SubscriberSchemeHttp SubscriberScheme = "http" SubscriberSchemeHttps SubscriberScheme = "https" )
Defines values for SubscriberScheme.
type UpdateLoad ¶
type UpdateLoad struct {
Load int64 `json:"load"`
}
UpdateLoad defines model for UpdateLoad.
type Worker ¶
type WorkerLoadUpdateJSONRequestBody ¶
type WorkerLoadUpdateJSONRequestBody UpdateLoad
WorkerLoadUpdateJSONRequestBody defines body for WorkerLoadUpdate for application/json ContentType.
type WorkerSubscribeJSONBodyScheme ¶
type WorkerSubscribeJSONBodyScheme string
WorkerSubscribeJSONBodyScheme defines parameters for WorkerSubscribe.
type WorkerSubscribeJSONRequestBody ¶
type WorkerSubscribeJSONRequestBody NewSubscriber
WorkerSubscribeJSONRequestBody defines body for WorkerSubscribe for application/json ContentType.