Documentation
¶
Index ¶
- Constants
- func BuildFilter(field, value string) string
- func BuildTagFilter(tag, value string) string
- func DeleteWithFilter[T any](finder func(*FilterOptions) ([]*T, error), deleter func(string) error, ...) error
- func GetByID[T any](finder func(*FilterOptions) ([]*T, error), id string, resourceType string) (*T, error)
- func GetByName[T any](finder func(*FilterOptions) ([]*T, error), name string, resourceType string) (*T, error)
- type AutomationError
- type BaseOptions
- type BaseResourceManager
- type Config
- type ConfigManager
- func (cm *ConfigManager) Create(opts *ConfigOptions) (string, error)
- func (cm *ConfigManager) Delete(id string) error
- func (cm *ConfigManager) DeleteWithFilter(filter string) error
- func (cm *ConfigManager) Find(opts *FilterOptions) ([]*rest_model.ConfigDetail, error)
- func (cm *ConfigManager) GetByID(id string) (*rest_model.ConfigDetail, error)
- func (cm *ConfigManager) GetByName(name string) (*rest_model.ConfigDetail, error)
- func (cm *ConfigManager) Update(id string, opts *ConfigOptions) error
- type ConfigOptions
- type ConfigTypeManager
- func (ctm *ConfigTypeManager) Create(opts *ConfigTypeOptions) (string, error)
- func (ctm *ConfigTypeManager) Delete(id string) error
- func (ctm *ConfigTypeManager) DeleteWithFilter(filter string) error
- func (ctm *ConfigTypeManager) EnsureExists(name string) (string, error)
- func (ctm *ConfigTypeManager) Find(opts *FilterOptions) ([]*rest_model.ConfigTypeDetail, error)
- func (ctm *ConfigTypeManager) GetByID(id string) (*rest_model.ConfigTypeDetail, error)
- func (ctm *ConfigTypeManager) GetByName(name string) (*rest_model.ConfigTypeDetail, error)
- type ConfigTypeOptions
- type EdgeRouterPolicyManager
- func (erpm *EdgeRouterPolicyManager) Create(opts *EdgeRouterPolicyOptions) (string, error)
- func (erpm *EdgeRouterPolicyManager) Delete(id string) error
- func (erpm *EdgeRouterPolicyManager) DeleteWithFilter(filter string) error
- func (erpm *EdgeRouterPolicyManager) Find(opts *FilterOptions) ([]*rest_model.EdgeRouterPolicyDetail, error)
- func (erpm *EdgeRouterPolicyManager) GetByID(id string) (*rest_model.EdgeRouterPolicyDetail, error)
- func (erpm *EdgeRouterPolicyManager) GetByName(name string) (*rest_model.EdgeRouterPolicyDetail, error)
- type EdgeRouterPolicyOptions
- type ErrorType
- type FilterOptions
- type IResourceManager
- type IdentityManager
- func (im *IdentityManager) Create(opts *IdentityOptions) (string, error)
- func (im *IdentityManager) Delete(id string) error
- func (im *IdentityManager) DeleteWithFilter(filter string) error
- func (im *IdentityManager) Enroll(id string) (*ziti.Config, error)
- func (im *IdentityManager) Find(opts *FilterOptions) ([]*rest_model.IdentityDetail, error)
- func (im *IdentityManager) GetByID(id string) (*rest_model.IdentityDetail, error)
- func (im *IdentityManager) GetByName(name string) (*rest_model.IdentityDetail, error)
- type IdentityOptions
- type ServiceEdgeRouterPolicyManager
- func (serpm *ServiceEdgeRouterPolicyManager) Create(opts *ServiceEdgeRouterPolicyOptions) (string, error)
- func (serpm *ServiceEdgeRouterPolicyManager) Delete(id string) error
- func (serpm *ServiceEdgeRouterPolicyManager) DeleteWithFilter(filter string) error
- func (serpm *ServiceEdgeRouterPolicyManager) Find(opts *FilterOptions) ([]*rest_model.ServiceEdgeRouterPolicyDetail, error)
- func (serpm *ServiceEdgeRouterPolicyManager) GetByID(id string) (*rest_model.ServiceEdgeRouterPolicyDetail, error)
- func (serpm *ServiceEdgeRouterPolicyManager) GetByName(name string) (*rest_model.ServiceEdgeRouterPolicyDetail, error)
- type ServiceEdgeRouterPolicyOptions
- type ServiceManager
- func (sm *ServiceManager) Create(opts *ServiceOptions) (string, error)
- func (sm *ServiceManager) Delete(id string) error
- func (sm *ServiceManager) DeleteWithFilter(filter string) error
- func (sm *ServiceManager) Find(opts *FilterOptions) ([]*rest_model.ServiceDetail, error)
- func (sm *ServiceManager) GetByID(id string) (*rest_model.ServiceDetail, error)
- func (sm *ServiceManager) GetByName(name string) (*rest_model.ServiceDetail, error)
- type ServiceOptions
- type ServicePolicyManager
- func (spm *ServicePolicyManager) Create(opts *ServicePolicyOptions) (string, error)
- func (spm *ServicePolicyManager) CreateBind(opts *ServicePolicyOptions) (string, error)
- func (spm *ServicePolicyManager) CreateDial(opts *ServicePolicyOptions) (string, error)
- func (spm *ServicePolicyManager) Delete(id string) error
- func (spm *ServicePolicyManager) DeleteWithFilter(filter string) error
- func (spm *ServicePolicyManager) Find(opts *FilterOptions) ([]*rest_model.ServicePolicyDetail, error)
- func (spm *ServicePolicyManager) GetByID(id string) (*rest_model.ServicePolicyDetail, error)
- func (spm *ServicePolicyManager) GetByName(name string) (*rest_model.ServicePolicyDetail, error)
- type ServicePolicyOptions
- type Tags
- func (t *Tags) ToRestModel() *rest_model.Tags
- func (t *Tags) WithAgentRemote(enrollmentToken, envZId string) *Tags
- func (t *Tags) WithEmail(email string) *Tags
- func (t *Tags) WithShareToken(token string) *Tags
- func (t *Tags) WithTag(key string, value interface{}) *Tags
- func (t *Tags) WithZrok() *Tags
- type ZitiAutomation
Constants ¶
View Source
const ( // DefaultRequestTimeout is the default timeout for API requests DefaultRequestTimeout = 30 * time.Second // DefaultOperationTimeout is the default timeout for CRUD operations DefaultOperationTimeout = 30 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func BuildFilter ¶
func BuildTagFilter ¶
func DeleteWithFilter ¶
func DeleteWithFilter[T any](finder func(*FilterOptions) ([]*T, error), deleter func(string) error, filter string, resourceType string) error
generic helper for bulk delete operations
Types ¶
type AutomationError ¶
func NewNotFoundError ¶
func NewNotFoundError(resource, operation string, cause error) *AutomationError
func (*AutomationError) Error ¶
func (e *AutomationError) Error() string
func (*AutomationError) IsNotFound ¶
func (e *AutomationError) IsNotFound() bool
func (*AutomationError) IsRetryable ¶
func (e *AutomationError) IsRetryable() bool
type BaseOptions ¶
type BaseOptions struct {
Name string
Tags *Tags
TagContext map[string]interface{}
Timeout time.Duration
}
func (*BaseOptions) GetTags ¶
func (bo *BaseOptions) GetTags() *rest_model.Tags
func (*BaseOptions) GetTimeout ¶
func (bo *BaseOptions) GetTimeout() time.Duration
type BaseResourceManager ¶
type BaseResourceManager[T any] struct { // contains filtered or unexported fields }
func NewBaseResourceManager ¶
func NewBaseResourceManager[T any](ziti *ZitiAutomation) *BaseResourceManager[T]
func (*BaseResourceManager[T]) Context ¶
func (brm *BaseResourceManager[T]) Context() context.Context
func (*BaseResourceManager[T]) Edge ¶
func (brm *BaseResourceManager[T]) Edge() *rest_management_api_client.ZitiEdgeManagement
type ConfigManager ¶
type ConfigManager struct {
*BaseResourceManager[rest_model.ConfigDetail]
}
func NewConfigManager ¶
func NewConfigManager(ziti *ZitiAutomation) *ConfigManager
func (*ConfigManager) Create ¶
func (cm *ConfigManager) Create(opts *ConfigOptions) (string, error)
func (*ConfigManager) Delete ¶
func (cm *ConfigManager) Delete(id string) error
func (*ConfigManager) DeleteWithFilter ¶
func (cm *ConfigManager) DeleteWithFilter(filter string) error
func (*ConfigManager) Find ¶
func (cm *ConfigManager) Find(opts *FilterOptions) ([]*rest_model.ConfigDetail, error)
func (*ConfigManager) GetByID ¶
func (cm *ConfigManager) GetByID(id string) (*rest_model.ConfigDetail, error)
func (*ConfigManager) GetByName ¶
func (cm *ConfigManager) GetByName(name string) (*rest_model.ConfigDetail, error)
func (*ConfigManager) Update ¶
func (cm *ConfigManager) Update(id string, opts *ConfigOptions) error
type ConfigOptions ¶
type ConfigOptions struct {
BaseOptions
ConfigTypeID string
Data interface{}
}
type ConfigTypeManager ¶
type ConfigTypeManager struct {
*BaseResourceManager[rest_model.ConfigTypeDetail]
}
func NewConfigTypeManager ¶
func NewConfigTypeManager(ziti *ZitiAutomation) *ConfigTypeManager
func (*ConfigTypeManager) Create ¶
func (ctm *ConfigTypeManager) Create(opts *ConfigTypeOptions) (string, error)
func (*ConfigTypeManager) Delete ¶
func (ctm *ConfigTypeManager) Delete(id string) error
func (*ConfigTypeManager) DeleteWithFilter ¶
func (ctm *ConfigTypeManager) DeleteWithFilter(filter string) error
func (*ConfigTypeManager) EnsureExists ¶
func (ctm *ConfigTypeManager) EnsureExists(name string) (string, error)
func (*ConfigTypeManager) Find ¶
func (ctm *ConfigTypeManager) Find(opts *FilterOptions) ([]*rest_model.ConfigTypeDetail, error)
func (*ConfigTypeManager) GetByID ¶
func (ctm *ConfigTypeManager) GetByID(id string) (*rest_model.ConfigTypeDetail, error)
func (*ConfigTypeManager) GetByName ¶
func (ctm *ConfigTypeManager) GetByName(name string) (*rest_model.ConfigTypeDetail, error)
type ConfigTypeOptions ¶
type ConfigTypeOptions struct {
BaseOptions
Schema interface{}
}
type EdgeRouterPolicyManager ¶
type EdgeRouterPolicyManager struct {
*BaseResourceManager[rest_model.EdgeRouterPolicyDetail]
}
func NewEdgeRouterPolicyManager ¶
func NewEdgeRouterPolicyManager(ziti *ZitiAutomation) *EdgeRouterPolicyManager
func (*EdgeRouterPolicyManager) Create ¶
func (erpm *EdgeRouterPolicyManager) Create(opts *EdgeRouterPolicyOptions) (string, error)
func (*EdgeRouterPolicyManager) Delete ¶
func (erpm *EdgeRouterPolicyManager) Delete(id string) error
func (*EdgeRouterPolicyManager) DeleteWithFilter ¶
func (erpm *EdgeRouterPolicyManager) DeleteWithFilter(filter string) error
func (*EdgeRouterPolicyManager) Find ¶
func (erpm *EdgeRouterPolicyManager) Find(opts *FilterOptions) ([]*rest_model.EdgeRouterPolicyDetail, error)
func (*EdgeRouterPolicyManager) GetByID ¶
func (erpm *EdgeRouterPolicyManager) GetByID(id string) (*rest_model.EdgeRouterPolicyDetail, error)
func (*EdgeRouterPolicyManager) GetByName ¶
func (erpm *EdgeRouterPolicyManager) GetByName(name string) (*rest_model.EdgeRouterPolicyDetail, error)
type EdgeRouterPolicyOptions ¶
type EdgeRouterPolicyOptions struct {
BaseOptions
IdentityRoles []string
EdgeRouterRoles []string
Semantic rest_model.Semantic
}
type FilterOptions ¶
func (*FilterOptions) GetLimit ¶
func (fo *FilterOptions) GetLimit() int64
func (*FilterOptions) GetTimeout ¶
func (fo *FilterOptions) GetTimeout() time.Duration
type IResourceManager ¶
type IdentityManager ¶
type IdentityManager struct {
*BaseResourceManager[rest_model.IdentityDetail]
}
func NewIdentityManager ¶
func NewIdentityManager(ziti *ZitiAutomation) *IdentityManager
func (*IdentityManager) Create ¶
func (im *IdentityManager) Create(opts *IdentityOptions) (string, error)
func (*IdentityManager) Delete ¶
func (im *IdentityManager) Delete(id string) error
func (*IdentityManager) DeleteWithFilter ¶
func (im *IdentityManager) DeleteWithFilter(filter string) error
func (*IdentityManager) Find ¶
func (im *IdentityManager) Find(opts *FilterOptions) ([]*rest_model.IdentityDetail, error)
func (*IdentityManager) GetByID ¶
func (im *IdentityManager) GetByID(id string) (*rest_model.IdentityDetail, error)
func (*IdentityManager) GetByName ¶
func (im *IdentityManager) GetByName(name string) (*rest_model.IdentityDetail, error)
type IdentityOptions ¶
type IdentityOptions struct {
BaseOptions
Type rest_model.IdentityType
IsAdmin bool
RoleAttributes []string
}
type ServiceEdgeRouterPolicyManager ¶
type ServiceEdgeRouterPolicyManager struct {
*BaseResourceManager[rest_model.ServiceEdgeRouterPolicyDetail]
}
func NewServiceEdgeRouterPolicyManager ¶
func NewServiceEdgeRouterPolicyManager(ziti *ZitiAutomation) *ServiceEdgeRouterPolicyManager
func (*ServiceEdgeRouterPolicyManager) Create ¶
func (serpm *ServiceEdgeRouterPolicyManager) Create(opts *ServiceEdgeRouterPolicyOptions) (string, error)
func (*ServiceEdgeRouterPolicyManager) Delete ¶
func (serpm *ServiceEdgeRouterPolicyManager) Delete(id string) error
func (*ServiceEdgeRouterPolicyManager) DeleteWithFilter ¶
func (serpm *ServiceEdgeRouterPolicyManager) DeleteWithFilter(filter string) error
func (*ServiceEdgeRouterPolicyManager) Find ¶
func (serpm *ServiceEdgeRouterPolicyManager) Find(opts *FilterOptions) ([]*rest_model.ServiceEdgeRouterPolicyDetail, error)
func (*ServiceEdgeRouterPolicyManager) GetByID ¶
func (serpm *ServiceEdgeRouterPolicyManager) GetByID(id string) (*rest_model.ServiceEdgeRouterPolicyDetail, error)
func (*ServiceEdgeRouterPolicyManager) GetByName ¶
func (serpm *ServiceEdgeRouterPolicyManager) GetByName(name string) (*rest_model.ServiceEdgeRouterPolicyDetail, error)
type ServiceEdgeRouterPolicyOptions ¶
type ServiceEdgeRouterPolicyOptions struct {
BaseOptions
ServiceRoles []string
EdgeRouterRoles []string
Semantic rest_model.Semantic
}
type ServiceManager ¶
type ServiceManager struct {
*BaseResourceManager[rest_model.ServiceDetail]
}
func NewServiceManager ¶
func NewServiceManager(ziti *ZitiAutomation) *ServiceManager
func (*ServiceManager) Create ¶
func (sm *ServiceManager) Create(opts *ServiceOptions) (string, error)
func (*ServiceManager) Delete ¶
func (sm *ServiceManager) Delete(id string) error
func (*ServiceManager) DeleteWithFilter ¶
func (sm *ServiceManager) DeleteWithFilter(filter string) error
func (*ServiceManager) Find ¶
func (sm *ServiceManager) Find(opts *FilterOptions) ([]*rest_model.ServiceDetail, error)
func (*ServiceManager) GetByID ¶
func (sm *ServiceManager) GetByID(id string) (*rest_model.ServiceDetail, error)
func (*ServiceManager) GetByName ¶
func (sm *ServiceManager) GetByName(name string) (*rest_model.ServiceDetail, error)
type ServiceOptions ¶
type ServicePolicyManager ¶
type ServicePolicyManager struct {
*BaseResourceManager[rest_model.ServicePolicyDetail]
}
func NewServicePolicyManager ¶
func NewServicePolicyManager(ziti *ZitiAutomation) *ServicePolicyManager
func (*ServicePolicyManager) Create ¶
func (spm *ServicePolicyManager) Create(opts *ServicePolicyOptions) (string, error)
func (*ServicePolicyManager) CreateBind ¶
func (spm *ServicePolicyManager) CreateBind(opts *ServicePolicyOptions) (string, error)
convenience methods for specific policy types
func (*ServicePolicyManager) CreateDial ¶
func (spm *ServicePolicyManager) CreateDial(opts *ServicePolicyOptions) (string, error)
func (*ServicePolicyManager) Delete ¶
func (spm *ServicePolicyManager) Delete(id string) error
func (*ServicePolicyManager) DeleteWithFilter ¶
func (spm *ServicePolicyManager) DeleteWithFilter(filter string) error
func (*ServicePolicyManager) Find ¶
func (spm *ServicePolicyManager) Find(opts *FilterOptions) ([]*rest_model.ServicePolicyDetail, error)
func (*ServicePolicyManager) GetByID ¶
func (spm *ServicePolicyManager) GetByID(id string) (*rest_model.ServicePolicyDetail, error)
func (*ServicePolicyManager) GetByName ¶
func (spm *ServicePolicyManager) GetByName(name string) (*rest_model.ServicePolicyDetail, error)
type ServicePolicyOptions ¶
type ServicePolicyOptions struct {
BaseOptions
IdentityRoles []string
ServiceRoles []string
PolicyType rest_model.DialBind
Semantic rest_model.Semantic
}
type Tags ¶
type Tags struct {
// contains filtered or unexported fields
}
func ZrokAgentRemoteTags ¶
func ZrokShareTags ¶
func (*Tags) ToRestModel ¶
func (t *Tags) ToRestModel() *rest_model.Tags
func (*Tags) WithAgentRemote ¶
func (*Tags) WithShareToken ¶
type ZitiAutomation ¶
type ZitiAutomation struct {
Identities *IdentityManager
Services *ServiceManager
Configs *ConfigManager
ConfigTypes *ConfigTypeManager
EdgeRouterPolicies *EdgeRouterPolicyManager
ServiceEdgeRouterPolicies *ServiceEdgeRouterPolicyManager
ServicePolicies *ServicePolicyManager
// contains filtered or unexported fields
}
func NewZitiAutomation ¶
func NewZitiAutomation(cfg *Config) (*ZitiAutomation, error)
func (*ZitiAutomation) CleanupByTag ¶
func (za *ZitiAutomation) CleanupByTag(tag, value string) error
func (*ZitiAutomation) Edge ¶
func (za *ZitiAutomation) Edge() *rest_management_api_client.ZitiEdgeManagement
func (*ZitiAutomation) IsNotFound ¶
func (za *ZitiAutomation) IsNotFound(err error) bool
func (*ZitiAutomation) ShouldRetry ¶
func (za *ZitiAutomation) ShouldRetry(err error) bool
Click to show internal directories.
Click to hide internal directories.