util

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const RSAPrivateKeyBlockType = "RSA PRIVATE KEY"

Variables

View Source
var WorkCreatedCondition = metav1.Condition{Type: "Created", Status: metav1.ConditionTrue}
View Source
var WorkUpdatedCondition = metav1.Condition{Type: "Updated", Status: metav1.ConditionTrue}

Functions

func AddWorkFinalizer

func AddWorkFinalizer(ctx context.Context, workClient workv1client.ManifestWorkInterface, name string) error

func AppendCAToCertPool

func AppendCAToCertPool(caCert *x509.Certificate) (*x509.CertPool, error)

func AssertUpdatedWork

func AssertUpdatedWork(ctx context.Context, workClient workv1client.ManifestWorkInterface, name string) error

func AssertWorkFinalizers

func AssertWorkFinalizers(ctx context.Context, workClient workv1client.ManifestWorkInterface, name string) error

func AssertWorkStatus

func AssertWorkStatus(ctx context.Context, workClient workv1client.ManifestWorkInterface, name string, condition metav1.Condition) error

func NewMQTTAgentOptions

func NewMQTTAgentOptions(brokerHost, sourceID, clusterName string) *mqtt.MQTTOptions

func NewMQTTAgentOptionsWithSourceBroadcast

func NewMQTTAgentOptionsWithSourceBroadcast(brokerHost, sourceID, clusterName string) *mqtt.MQTTOptions

func NewMQTTSourceOptions

func NewMQTTSourceOptions(brokerHost, sourceID string) *mqtt.MQTTOptions

func NewMQTTSourceOptionsWithSourceBroadcast

func NewMQTTSourceOptionsWithSourceBroadcast(brokerHost, sourceID string) *mqtt.MQTTOptions

func NewManifest

func NewManifest(name string) workv1.Manifest

func NewManifestWork

func NewManifestWork(namespace, name string, withVersion bool) *workv1.ManifestWork

func NewManifestWorkWithStatus

func NewManifestWorkWithStatus(namespace, name string) *workv1.ManifestWork

func RemoveWorkFinalizer

func RemoveWorkFinalizer(ctx context.Context, workClient workv1client.ManifestWorkInterface, name string) error

func UpdateWork

func UpdateWork(ctx context.Context, workClient workv1client.ManifestWorkInterface, name string, withVersion bool) error

func UpdateWorkStatus

func UpdateWorkStatus(ctx context.Context, workClient workv1client.ManifestWorkInterface, name string, condition metav1.Condition) error

Types

type AllowHook

type AllowHook struct {
	mqtt.HookBase
}

func (*AllowHook) ID

func (h *AllowHook) ID() string

ID returns the ID of the hook.

func (*AllowHook) OnACLCheck

func (h *AllowHook) OnACLCheck(cl *mqtt.Client, topic string, write bool) bool

OnACLCheck returns true/allowed for all checks.

func (*AllowHook) OnConnectAuthenticate

func (h *AllowHook) OnConnectAuthenticate(cl *mqtt.Client, pk packets.Packet) bool

OnConnectAuthenticate returns true/allowed for all requests.

func (*AllowHook) Provides

func (h *AllowHook) Provides(b byte) bool

Provides indicates which hook methods this hook provides.

type ClientCertPairs

type ClientCertPairs struct {
	ClientCert []byte
	ClientKey  []byte
}

func SignClientCert

func SignClientCert(caCert *x509.Certificate, caKey *rsa.PrivateKey, d time.Duration) (*ClientCertPairs, error)

type ServerCertPairs

type ServerCertPairs struct {
	CA            *x509.Certificate
	CAKey         *rsa.PrivateKey
	ServerTLSCert tls.Certificate
}

func NewServerCertPairs

func NewServerCertPairs() (*ServerCertPairs, error)

Jump to

Keyboard shortcuts

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