Documentation
¶
Index ¶
- Variables
- func DoWithClientConn(parent glue.Context, scannerName string, cb func(*grpc.ClientConn) error) error
- func DoWithControlClient(parent glue.Context, cb func(ControlClient) error) error
- func IsVerbose(parent glue.Context) (verbose bool)
- type AcmeAccount
- type AcmeResource
- type AcmeUser
- type Application
- type ApplicationFlags
- type AuthorizationMiddleware
- type AuthorizedUser
- type AutocertStorage
- type AutoupdateService
- type CertificateDesc
- type CertificateIssueService
- type CertificateIssuer
- type CertificateManager
- type CertificateRepository
- type CertificateService
- type ClientScanner
- type Command
- type Component
- type ConfigRepository
- type ControlClient
- type CoreScanner
- type DNSProvider
- type DNSProviderClient
- type DNSRecord
- type DynDNSService
- type FlagSetRegistrar
- type IssuedCertificate
- type JobInfo
- type JobService
- type Mail
- type MailService
- type NatService
- type NodeService
- type Page
- type Record
- type ResourceService
- type Server
- type ServerScanner
- type StorageConsoleStream
- type StorageService
- type SystemEnvironmentPropertyResolver
- type Whois
- type WhoisService
Constants ¶
This section is empty.
Variables ¶
View Source
var ( LogClass = reflect.TypeOf((*zap.Logger)(nil)) // *zap.Logger LumberjackClass = reflect.TypeOf((*lumberjack.Logger)(nil)) // *lumberjack.Logger FileSystemClass = reflect.TypeOf((*http.FileSystem)(nil)).Elem() // http.FileSystem FlagSetClass = reflect.TypeOf((*flag.FlagSet)(nil)) // *flag.FlagSet )
View Source
var ( TlsConfigClass = reflect.TypeOf((*tls.Config)(nil)) // *tls.Config GrpcServerClass = reflect.TypeOf((*grpc.Server)(nil)) // *grpc.Server HealthCheckerClass = reflect.TypeOf((*health.Server)(nil)) // *health.Server HttpServerClass = reflect.TypeOf((*http.Server)(nil)) // *http.Server )
View Source
var ApplicationClass = reflect.TypeOf((*Application)(nil)).Elem()
View Source
var ApplicationFlagsClass = reflect.TypeOf((*ApplicationFlags)(nil)).Elem()
View Source
var AuthenticationServiceClass = reflect.TypeOf((*AuthorizationMiddleware)(nil)).Elem()
View Source
var AutocertStorageClass = reflect.TypeOf((*AutocertStorage)(nil)).Elem()
View Source
var AutoupdateServiceClass = reflect.TypeOf((*AutoupdateService)(nil)).Elem()
View Source
var CertificateIssuerClass = reflect.TypeOf((*CertificateIssuer)(nil)).Elem()
View Source
var CertificateIssuerServiceClass = reflect.TypeOf((*CertificateIssueService)(nil)).Elem()
View Source
var CertificateManagerClass = reflect.TypeOf((*CertificateManager)(nil)).Elem()
View Source
var CertificateRepositoryClass = reflect.TypeOf((*CertificateRepository)(nil)).Elem()
View Source
var CertificateServiceClass = reflect.TypeOf((*CertificateService)(nil)).Elem()
View Source
var ClientScannerClass = reflect.TypeOf((*ClientScanner)(nil)).Elem()
View Source
var CommandClass = reflect.TypeOf((*Command)(nil)).Elem()
View Source
var ComponentClass = reflect.TypeOf((*Component)(nil)).Elem()
* Generic component class that has a name
View Source
var ConfigRepositoryClass = reflect.TypeOf((*ConfigRepository)(nil)).Elem()
View Source
var ControlClientClass = reflect.TypeOf((*ControlClient)(nil)).Elem()
View Source
var CoreScannerClass = reflect.TypeOf((*CoreScanner)(nil)).Elem()
View Source
var DNSProviderClass = reflect.TypeOf((*DNSProvider)(nil)).Elem()
View Source
var DNSProviderClientClass = reflect.TypeOf((*DNSProviderClient)(nil)).Elem()
View Source
var DynDNSServiceClass = reflect.TypeOf((*DynDNSService)(nil)).Elem()
View Source
var FlagSetRegistrarClass = reflect.TypeOf((*FlagSetRegistrar)(nil)).Elem()
View Source
var GrpcClientConnClass = reflect.TypeOf((*grpc.ClientConn)(nil)) // *grpc.ClientConn
View Source
var JobServiceClass = reflect.TypeOf((*JobService)(nil)).Elem()
View Source
var MailServiceClass = reflect.TypeOf((*MailService)(nil)).Elem()
View Source
var NatServiceClass = reflect.TypeOf((*NatService)(nil)).Elem()
View Source
var NodeServiceClass = reflect.TypeOf((*NodeService)(nil)).Elem()
View Source
var PageClass = reflect.TypeOf((*Page)(nil)).Elem()
View Source
var ResourceServiceClass = reflect.TypeOf((*ResourceService)(nil)).Elem()
View Source
var ServerClass = reflect.TypeOf((*Server)(nil)).Elem()
View Source
var ServerScannerClass = reflect.TypeOf((*ServerScanner)(nil)).Elem()
View Source
var StorageServiceClass = reflect.TypeOf((*StorageService)(nil)).Elem()
View Source
var SystemEnvironmentPropertyResolverClass = reflect.TypeOf((*SystemEnvironmentPropertyResolver)(nil)).Elem()
View Source
var WhoisServiceClass = reflect.TypeOf((*WhoisService)(nil)).Elem()
Functions ¶
func DoWithClientConn ¶ added in v1.0.7
func DoWithControlClient ¶ added in v1.0.8
func DoWithControlClient(parent glue.Context, cb func(ControlClient) error) error
Types ¶
type AcmeAccount ¶
type AcmeAccount struct {
Status string `json:"status,omitempty"`
Contact []string `json:"contact,omitempty"`
TermsOfServiceAgreed bool `json:"termsOfServiceAgreed,omitempty"`
Orders string `json:"orders,omitempty"`
OnlyReturnExisting bool `json:"onlyReturnExisting,omitempty"`
ExternalAccountBinding json.RawMessage `json:"externalAccountBinding,omitempty"`
}
type AcmeResource ¶
type AcmeResource struct {
Body AcmeAccount `json:"body,omitempty"`
URI string `json:"uri,omitempty"`
}
type AcmeUser ¶
type AcmeUser struct {
Email string
Registration *AcmeResource
PrivateKey crypto.PrivateKey
}
type Application ¶
type Application interface {
context.Context
glue.InitializingBean
glue.NamedBean
Component
/**
Add beans to application context
*/
AppendBeans(beans ...interface{})
/**
Gets application name, represents lower case normalized executable name
*/
Name() string
/**
Gets application version at the time of compilation
*/
Version() string
/**
Gets application build at the time of compilation
*/
Build() string
/**
Gets application runtime profile, could be: dev, qa, prod and etc.
*/
Profile() string
/**
Checks if application running in dev mode
*/
IsDev() bool
/**
Gets application binary name, used on startup, could be different with application name
*/
Executable() string
/**
Gets home directory of the application, usually parent directory of binary folder where executable is running, not current directory
*/
ApplicationDir() string
/**
Run application with command line arguments
*/
Run(args []string) error
/**
Indicator if application is active and not in shutting down mode
*/
Active() bool
/**
Sets the flag that application is in shutting down mode then notify all go routines by ShutdownChannel then notify signal channel with interrupt signal
Additionally sets the flag that application is going to be restarted after shutdown
*/
Shutdown(restart bool)
/**
Indicator if application needs to be restarted by autoupdate or remote command after shutdown
*/
Restarting() bool
}
*
Application is the base entry point class for golang application.
type ApplicationFlags ¶
type AuthorizationMiddleware ¶
type AuthorizationMiddleware interface {
glue.InitializingBean
Authenticate(ctx context.Context) (context.Context, error)
GetUser(ctx context.Context) (*AuthorizedUser, bool)
HasUserRole(ctx context.Context, role string) bool
UserContext(ctx context.Context, name string) (string, bool)
GenerateToken(user *AuthorizedUser) (string, error)
ParseToken(token string) (*AuthorizedUser, error)
InvalidateToken(token string)
}
type AuthorizedUser ¶
type AutocertStorage ¶
type AutoupdateService ¶
type AutoupdateService interface {
glue.InitializingBean
glue.DisposableBean
Freeze(jobName string) int64
Unfreeze(handle int64)
FreezeJobs() map[int64]string
}
type CertificateDesc ¶
type CertificateIssueService ¶
type CertificateIssueService interface {
LoadCertificateDesc() (*CertificateDesc, error)
CreateIssuer(cn string, info *CertificateDesc) (CertificateIssuer, error)
LoadIssuer(*sprintpb.SelfSigner) (CertificateIssuer, error)
LocalIPAddresses(addLocalhost bool) ([]net.IP, error)
}
type CertificateIssuer ¶
type CertificateIssuer interface {
Parent() (CertificateIssuer, bool)
Certificate() IssuedCertificate
IssueInterCert(cn string) (CertificateIssuer, error)
IssueClientCert(cn string, password string) (cert IssuedCertificate, pfxData []byte, err error)
IssueServerCert(cn string, domains []string, ipAddresses []net.IP) (IssuedCertificate, error)
}
type CertificateManager ¶
type CertificateManager interface {
glue.InitializingBean
glue.DisposableBean
GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, error)
InvalidateCache(domain string)
ListActive() map[string]error
ListRenewal() map[string]time.Time
ListUnknown() map[string]time.Time
ExecuteCommand(cmd string, args []string) (string, error)
}
type CertificateRepository ¶
type CertificateRepository interface {
glue.DisposableBean
/**
Self Signer CRUID
*/
SaveSelfSigner(self *sprintpb.SelfSigner) error
FindSelfSigner(name string) (*sprintpb.SelfSigner, error)
ListSelfSigners(prefix string, cb func(*sprintpb.SelfSigner) bool) error
DeleteSelfSigner(name string) error
/**
Acme Account CRUID
*/
SaveAccount(account *sprintpb.AcmeAccount) error
FindAccount(email string) (*sprintpb.AcmeAccount, error)
ListAccounts(prefix string, cb func(*sprintpb.AcmeAccount) bool) error
DeleteAccount(email string) error
SaveZone(zone *sprintpb.Zone) error
FindZone(zone string) (*sprintpb.Zone, error)
ListZones(prefix string, cb func(*sprintpb.Zone) bool) error
DeleteZone(zone string) error
Watch(ctx context.Context, cb func(zone, event string) bool) (cancel context.CancelFunc, err error)
Backend() store.DataStore
/**
Sets backend using for storing certificates
*/
SetBackend(storage store.DataStore)
}
type CertificateService ¶
type CertificateService interface {
glue.InitializingBean
CreateAcmeAccount(email string) error
GetOrCreateAcmeUser(email string) (user *AcmeUser, err error)
CreateSelfSigner(cn string, withInter bool) error
RenewCertificate(zone string) error
ExecuteCommand(cmd string, args []string) (string, error)
IssueAcmeCertificate(entry *sprintpb.Zone) (string, error)
IssueSelfSignedCertificate(entry *sprintpb.Zone) error
}
type ClientScanner ¶
type ClientScanner interface {
ScannerName() string
ClientBeans() []interface{}
}
func FindClientScanner ¶ added in v1.0.8
func FindClientScanner(parent glue.Context, scannerName string) (ClientScanner, error)
type ConfigRepository ¶
type ConfigRepository interface {
glue.DisposableBean
glue.PropertyResolver
Get(key string) (string, error)
EnumerateAll(prefix string, cb func(key, value string) bool) error
Set(key, value string) error
Watch(context context.Context, prefix string, cb func(key, value string) bool) (context.CancelFunc, error)
Backend() store.DataStore
/**
Sets backend using for storing properties
*/
SetBackend(storage store.DataStore)
}
type ControlClient ¶
type ControlClient interface {
glue.InitializingBean
glue.DisposableBean
Status() (string, error)
Shutdown(restart bool) (string, error)
ConfigCommand(command string, args []string) (string, error)
CertificateCommand(command string, args []string) (string, error)
JobCommand(command string, args []string) (string, error)
StorageCommand(command string, args []string) (string, error)
StorageConsole(writer io.StringWriter, errWriter io.StringWriter) error
}
type CoreScanner ¶
type CoreScanner interface {
/**
Gets core beans that will extend application beans, parent context.
*/
CoreBeans() []interface{}
}
*
Core scanner is using to find beans to create core context when application is already created.
type DNSProvider ¶
type DNSProviderClient ¶
type DNSRecord ¶
type DNSRecord struct {
ID string `json:"id,omitempty"`
Hostname string `json:"hostname,omitempty"`
TTL int `json:"ttl,omitempty"`
Type string `json:"type,omitempty"`
Priority int `json:"priority,omitempty"`
Value string `json:"value,omitempty"`
}
DNSRecord DNS record representation.
type DynDNSService ¶
type FlagSetRegistrar ¶
type IssuedCertificate ¶
type JobService ¶
type MailService ¶
type NatService ¶
type NodeService ¶
type ResourceService ¶
type ResourceService interface {
/*
Gets resource by name
*/
GetResource(name string) ([]byte, error)
/*
Gets text template resource by name
*/
TextTemplate(name string) (*textTemplate.Template, error)
/*
Gets html template resource by name
*/
HtmlTemplate(name string) (*htmlTemplate.Template, error)
/*
Gets using licences of imported modules
*/
GetLicenses(name string) (string, error)
/*
Gets open api swagger JSON files for resource source
*/
GetOpenAPI(source string) string
}
type Server ¶
type Server interface {
glue.InitializingBean
glue.DisposableBean
Bind() error
Active() bool
ListenAddress() net.Addr
Serve() error
Stop()
}
type ServerScanner ¶
type ServerScanner interface {
ServerBeans() []interface{}
}
type StorageConsoleStream ¶
type StorageConsoleStream interface {
Send(*sprintpb.StorageConsoleResponse) error
Recv() (*sprintpb.StorageConsoleRequest, error)
}
type StorageService ¶
type StorageService interface {
glue.InitializingBean
Execute(name, query string, cb func(string) bool) error
ExecuteCommand(cmd string, args []string) (string, error)
Console(stream StorageConsoleStream) error
LocalConsole(writer io.StringWriter, errWriter io.StringWriter) error
}
Click to show internal directories.
Click to hide internal directories.