Documentation
¶
Index ¶
- Variables
- type AcmeAccount
- type AcmeResource
- type AcmeUser
- type Application
- type ApplicationFlags
- type AsymmetricSealer
- type AsymmetricSigner
- type AuthenticatedCipher
- type AuthorizationMiddleware
- type AuthorizedUser
- type AutocertStorage
- type AutoupdateService
- type CertificateDesc
- type CertificateIssueService
- type CertificateIssuer
- type CertificateManager
- type CertificateRepository
- type CertificateService
- type CipherOption
- type CipherOptions
- 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 SealService
- type SealerOption
- type SealerOptions
- 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 AutocertManagerClass = reflect.TypeOf((*autocert.Manager)(nil)) // *autocert.Manager 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 GrpcClientClass = 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 SealServiceClass = reflect.TypeOf((*SealService)(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 ¶
This section is empty.
Types ¶
type AcmeAccount ¶
type AcmeAccount struct {
// status (required, string):
// The status of this account.
// Possible values are: "valid", "deactivated", and "revoked".
// The value "deactivated" should be used to indicate client-initiated deactivation
// whereas "revoked" should be used to indicate server- initiated deactivation. (See Section 7.1.6)
Status string `json:"status,omitempty"`
// contact (optional, array of string):
// An array of URLs that the server can use to contact the client for issues related to this account.
// For example, the server may wish to notify the client about server-initiated revocation or certificate expiration.
// For information on supported URL schemes, see Section 7.3
Contact []string `json:"contact,omitempty"`
// termsOfServiceAgreed (optional, boolean):
// Including this field in a new-account request,
// with a value of true, indicates the client's agreement with the terms of service.
// This field is not updateable by the client.
TermsOfServiceAgreed bool `json:"termsOfServiceAgreed,omitempty"`
// orders (required, string):
// A URL from which a list of orders submitted by this account can be fetched via a POST-as-GET request,
// as described in Section 7.1.2.1.
Orders string `json:"orders,omitempty"`
// onlyReturnExisting (optional, boolean):
// If this field is present with the value "true",
// then the server MUST NOT create a new account if one does not already exist.
// This allows a client to look up an account URL based on an account key (see Section 7.3.1).
OnlyReturnExisting bool `json:"onlyReturnExisting,omitempty"`
// externalAccountBinding (optional, object):
// An optional field for binding the new account with an existing non-ACME account (see Section 7.3.4).
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
}
func (*AcmeUser) GetPrivateKey ¶
func (u *AcmeUser) GetPrivateKey() crypto.PrivateKey
func (*AcmeUser) GetRegistration ¶
func (u *AcmeUser) GetRegistration() *AcmeResource
type Application ¶
type Application interface {
context.Context
gluten.InitializingBean
gluten.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 AsymmetricSealer ¶
type AsymmetricSealer interface {
PublicKey() crypto.PublicKey
PrivateKey() crypto.PrivateKey
EncodePublicKey() (string, error)
EncodePrivateKey() (string, error)
Seal(plaintext []byte, recipient crypto.PublicKey) (ciphertext []byte, err error)
Open(ciphertext []byte, sender crypto.PublicKey) (plaintext []byte, err error)
}
type AsymmetricSigner ¶
type AuthenticatedCipher ¶
type AuthorizationMiddleware ¶
type AuthorizationMiddleware interface {
gluten.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 {
gluten.InitializingBean
gluten.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(*saucepb.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 {
gluten.InitializingBean
gluten.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 {
gluten.DisposableBean
/**
Self Signer CRUID
*/
SaveSelfSigner(self *saucepb.SelfSigner) error
FindSelfSigner(name string) (*saucepb.SelfSigner, error)
ListSelfSigners(prefix string, cb func(*saucepb.SelfSigner) bool) error
DeleteSelfSigner(name string) error
/**
Acme Account CRUID
*/
SaveAccount(account *saucepb.AcmeAccount) error
FindAccount(email string) (*saucepb.AcmeAccount, error)
ListAccounts(prefix string, cb func(*saucepb.AcmeAccount) bool) error
DeleteAccount(email string) error
SaveZone(zone *saucepb.Zone) error
FindZone(zone string) (*saucepb.Zone, error)
ListZones(prefix string, cb func(*saucepb.Zone) bool) error
DeleteZone(zone string) error
Watch(ctx context.Context, cb func(zone, event string) bool) (cancel context.CancelFunc, err error)
Backend() fastfood.DataStore
/**
Sets backend using for storing certificates
*/
SetBackend(storage fastfood.DataStore)
}
type CertificateService ¶
type CertificateService interface {
gluten.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 *saucepb.Zone) (string, error)
IssueSelfSignedCertificate(entry *saucepb.Zone) error
}
type CipherOption ¶
type CipherOption interface {
Apply(*CipherOptions) error
}
type CipherOptions ¶
type ClientScanner ¶
type ClientScanner interface {
ClientBeans() []interface{}
}
type ConfigRepository ¶
type ConfigRepository interface {
gluten.DisposableBean
gluten.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() fastfood.DataStore
/**
Sets backend using for storing properties
*/
SetBackend(storage fastfood.DataStore)
}
type ControlClient ¶
type ControlClient interface {
gluten.InitializingBean
gluten.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 SealService ¶
type SealService interface {
IssueSealer(algorithm string, bits int) (AsymmetricSealer, error)
Sealer(options ...SealerOption) (AsymmetricSealer, error)
IssueSigner(algorithm string, bits int) (AsymmetricSigner, error)
Signer(options ...SealerOption) (AsymmetricSigner, error)
AuthenticatedCipher(options ...CipherOption) (AuthenticatedCipher, error)
}
type SealerOption ¶
type SealerOption interface {
Apply(*SealerOptions) error
}
type SealerOptions ¶
type SealerOptions struct {
Algorithm string
PublicKey crypto.PublicKey
PrivateKey crypto.PrivateKey // optional
}
type Server ¶
type Server interface {
gluten.InitializingBean
gluten.DisposableBean
Bind() error
Active() bool
ListenAddress() net.Addr
Serve() error
Stop()
}
type ServerScanner ¶
type ServerScanner interface {
ServerBeans() []interface{}
}
type StorageConsoleStream ¶
type StorageConsoleStream interface {
Send(*saucepb.StorageConsoleResponse) error
Recv() (*saucepb.StorageConsoleRequest, error)
}
type StorageService ¶
type StorageService interface {
gluten.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.