Documentation
¶
Overview ¶
Copyright 2022 Evan Hazlett
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022 Evan Hazlett ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022 Evan Hazlett ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022 Evan Hazlett ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022 Evan Hazlett ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func GenerateHash(v ...string) string
- func GenerateToken(v ...string) string
- func GetContentType(f *os.File) (string, error)
- func GetMinioClient(cfg *Config) (*minio.Client, error)
- func GetNamespaceFromContext(ctx context.Context) (string, error)
- func GetTokenFromContext(ctx context.Context) (string, error)
- type AuthenticatorConfig
- type Config
Constants ¶
const ( // QueueSubjectJobPriorityNormal is normal priority for workflows QueueSubjectJobPriorityNormal = "normal" // QueueSubjectJobPriorityUrgent is urgent priority for workflows (processed first) QueueSubjectJobPriorityUrgent = "urgent" // QueueSubjectJobPriorityLow is low priority for workflows (processed last) QueueSubjectJobPriorityLow = "low" // S3WorkflowPath is the path in the s3 bucket for workflow content S3WorkflowPath = "workflows" // CtxTokenKey is the key stored in the context for the token CtxTokenKey = "token" // CtxAPITokenKey is the user api token key stored in the context CtxAPITokenKey = "api-token" // CtxServiceTokenKey is the service key stored in the context CtxServiceTokenKey = "service-token" // CtxTokenKey is the key stored in the context for the username CtxUsernameKey = "username" // CtxTokenKey is the key stored in the context if the user is an admin CtxAdminKey = "isAdmin" // CtxNamespaceKey is the key stored in the context for the namespace CtxNamespaceKey = "namespace" // CtxDefaultNamespace is the default key used when unauthenticated and no auth CtxDefaultNamespace = "default" )
Variables ¶
This section is empty.
Functions ¶
func GenerateHash ¶
GenerateHash generates a sha256 hash of the string
func GenerateToken ¶
GenerateToken returns a sha256 of the specified data
func GetContentType ¶
GetContentType returns the content type of the specified file
func GetMinioClient ¶
GetMinioClient returns a MinIO client using the specified flow.Config
func GetNamespaceFromContext ¶
GetNamespaceFromContext returns the namespace from the specified context
Types ¶
type AuthenticatorConfig ¶
type Config ¶
type Config struct {
// GRPCAddress is the address for the grpc server
GRPCAddress string
// TLSCertificate is the certificate used for grpc communication
TLSServerCertificate string
// TLSKey is the key used for grpc communication
TLSServerKey string
// TLSClientCertificate is the client certificate used for client communication
TLSClientCertificate string
// TLSClientKey is the client key used for client communication
TLSClientKey string
// TLSInsecureSkipVerify disables certificate verification
TLSInsecureSkipVerify bool
// S3Endpoint is the endpoint for the S3 compatible service
S3Endpoint string
// S3AccessID is the S3 access id
S3AccessID string
// S3AccessKey is the S3 key
S3AccessKey string
// S3Bucket is the S3 bucket
S3Bucket string
// S3UseSSL enables SSL for the S3 service
S3UseSSL bool
// DatabaseAddress is the address of the database
DatabaseAddress string
// QueueAddress is the address of the queue
QueueAddress string
// ProfilerAddress enables the performance profiler on the specified address
ProfilerAddress string
// TraceEndpoint is the endpoint of the telemetry tracer
TraceEndpoint string
// Environment is the environment the app is running in
Environment string
// InitialAdminPassword is the password used when creating the initial admin account. If empty, a random one is generated.
InitialAdminPassword string
// Authenticator is the auth configuration
Authenticator *AuthenticatorConfig
}
Config is the configuration used for the server
func DefaultConfig ¶
func DefaultConfig() *Config
func LoadConfig ¶
LoadConfig returns a Flow config from the specified file path