Documentation
¶
Index ¶
- type DeploymentAction
- type DiscordService
- type DiscordTokenResponse
- type KubernetesService
- type KubernetesServiceImpl
- func (k *KubernetesServiceImpl) AddAction(action ResourceAction)
- func (k *KubernetesServiceImpl) ApplyResources() ([]string, error)
- func (k *KubernetesServiceImpl) DoesPvcExist(name string) bool
- func (k *KubernetesServiceImpl) GetActions() []ResourceAction
- func (k *KubernetesServiceImpl) GetClient() kubernetes.Interface
- func (k *KubernetesServiceImpl) GetClusterIp() (string, error)
- func (k *KubernetesServiceImpl) RemoveFinalizersAndDelete(name string) error
- func (k *KubernetesServiceImpl) Rollback() ([]string, error)
- type Message
- type Mod
- type ModNexusService
- type PVCAction
- type RabbitMqService
- type ResourceAction
- type S3Service
- func (s *S3Service) DeleteObject(ctx context.Context, key string) error
- func (s *S3Service) DeleteObjectsWithPrefix(ctx context.Context, prefix string) error
- func (s *S3Service) GeneratePutSignedUrl(prefix string, expiration time.Duration) (string, error)
- func (s *S3Service) ListObjects(prefix string) ([]SimpleS3Object, error)
- func (s *S3Service) UploadObject(ctx context.Context, key string) (*s3.PutObjectOutput, error)
- type SimpleS3Object
- type StripeService
- type UserResponse
- type Wrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeploymentAction ¶
type DeploymentAction struct {
Deployment *appsv1.Deployment
}
DeploymentAction represents a Deployment resource action.
func (DeploymentAction) Apply ¶
func (d DeploymentAction) Apply(clientset kubernetes.Interface) (string, error)
func (DeploymentAction) Name ¶
func (d DeploymentAction) Name() string
func (DeploymentAction) Rollback ¶
func (d DeploymentAction) Rollback(clientset kubernetes.Interface) (string, error)
type DiscordService ¶
type DiscordService struct {
// contains filtered or unexported fields
}
DiscordService handles OAuth2 authentication and API calls
func MakeDiscordService ¶
func MakeDiscordService() (*DiscordService, error)
MakeDiscordService creates a new Discord service
func (*DiscordService) ExchangeCodeForToken ¶
func (c *DiscordService) ExchangeCodeForToken(code, origin string) (*DiscordTokenResponse, error)
ExchangeCodeForToken exchanges an authorization code for an access token
func (*DiscordService) GetUserInfo ¶
func (c *DiscordService) GetUserInfo(accessToken string) (*UserResponse, error)
GetUserInfo retrieves the user's information using the access token
type DiscordTokenResponse ¶
type DiscordTokenResponse struct { AccessToken string `json:"access_token"` TokenType string `json:"token_type"` ExpiresIn int `json:"expires_in"` RefreshToken string `json:"refresh_token"` Scope string `json:"scope"` }
DiscordTokenResponse represents Discord's token response
type KubernetesService ¶
type KubernetesService interface { AddAction(action ResourceAction) ApplyResources() ([]string, error) GetActions() []ResourceAction GetClient() kubernetes.Interface GetClusterIp() (string, error) Rollback() ([]string, error) DoesPvcExist(name string) bool RemoveFinalizersAndDelete(name string) error }
func MakeKubernetesService ¶
func MakeKubernetesService(config *rest.Config) KubernetesService
MakeKubernetesService Creates a new kubernetes service object which intelligently loads configuration from either in-cluster or local if in-cluster fails.
type KubernetesServiceImpl ¶
type KubernetesServiceImpl struct { Client kubernetes.Interface ResourceActions []ResourceAction }
func (*KubernetesServiceImpl) AddAction ¶
func (k *KubernetesServiceImpl) AddAction(action ResourceAction)
func (*KubernetesServiceImpl) ApplyResources ¶
func (k *KubernetesServiceImpl) ApplyResources() ([]string, error)
ApplyResources applies a list of resources and rolls them back on failure.
func (*KubernetesServiceImpl) DoesPvcExist ¶
func (k *KubernetesServiceImpl) DoesPvcExist(name string) bool
DoesPvcExist Returns true if the pvc exists and false otherwise
func (*KubernetesServiceImpl) GetActions ¶
func (k *KubernetesServiceImpl) GetActions() []ResourceAction
func (*KubernetesServiceImpl) GetClient ¶
func (k *KubernetesServiceImpl) GetClient() kubernetes.Interface
func (*KubernetesServiceImpl) GetClusterIp ¶
func (k *KubernetesServiceImpl) GetClusterIp() (string, error)
GetClusterIp Returns the ipv4 WAN address for the cluster. This will be the address returned to users where they can point their Valheim client's to connect.
func (*KubernetesServiceImpl) RemoveFinalizersAndDelete ¶
func (k *KubernetesServiceImpl) RemoveFinalizersAndDelete(name string) error
RemoveFinalizersAndDelete Removes a PVC's finalizers setting them to null and deletes the PVC.
func (*KubernetesServiceImpl) Rollback ¶
func (k *KubernetesServiceImpl) Rollback() ([]string, error)
type Mod ¶
type Mod struct { Id string `json:"mod_id"` Version string `json:"version"` Updated string `json:"updated_time"` Created string `json:"created_time"` Name string `json:"name"` Summary string `json:"summary"` Image string `json:"picture_url"` Downloads int64 `json:"mod_downloads"` Author string `json:"author"` }
type ModNexusService ¶
func MakeModNexusService ¶
func MakeModNexusService() *ModNexusService
func (*ModNexusService) ModIdForPrefix ¶
func (m *ModNexusService) ModIdForPrefix(prefix string) string
type PVCAction ¶
type PVCAction struct {
PVC *corev1.PersistentVolumeClaim
}
PVCAction represents a PersistentVolumeClaim resource action.
type RabbitMqService ¶
type RabbitMqService struct { Connection *amqp.Connection ConsumeChannel *amqp.Channel PublishChannel *amqp.Channel Queue *amqp.Queue // contains filtered or unexported fields }
func MakeRabbitMQService ¶
func MakeRabbitMQService(exchangeName, routingKey string) (*RabbitMqService, error)
func (*RabbitMqService) Close ¶
func (r *RabbitMqService) Close()
func (*RabbitMqService) PublishMessage ¶
func (r *RabbitMqService) PublishMessage(message *Message) error
type ResourceAction ¶
type ResourceAction interface { Apply(clientset kubernetes.Interface) (string, error) Rollback(clientset kubernetes.Interface) (string, error) Name() string }
ResourceAction defines an interface for applying and rolling back Kubernetes resources.
type S3Service ¶
type S3Service struct {
// contains filtered or unexported fields
}
func MakeS3Service ¶
MakeS3Service creates a new instance of S3Service
func (*S3Service) DeleteObject ¶
DeleteObject deletes an object from S3
func (*S3Service) DeleteObjectsWithPrefix ¶
DeleteObjectsWithPrefix deletes all objects with the given prefix
func (*S3Service) GeneratePutSignedUrl ¶
GeneratePutSignedUrl Generates a signed url for uploading an object to S3
func (*S3Service) ListObjects ¶
func (s *S3Service) ListObjects(prefix string) ([]SimpleS3Object, error)
ListObjects lists all objects in a bucket with given prefix
func (*S3Service) UploadObject ¶
UploadObject publishes an object to S3 under the given prefix
type SimpleS3Object ¶
type StripeService ¶
type StripeService struct{}
func MakeStripeService ¶
func MakeStripeService() *StripeService
func (*StripeService) GetActiveSubscription ¶
func (s *StripeService) GetActiveSubscription(customerId string, subscriptionId string) (string, error)
GetActiveSubscription checks if a subscription is active for a given customer
func (*StripeService) GetSubscriptionLimits ¶
func (s *StripeService) GetSubscriptionLimits(subscriptionId string) (*model.SubscriptionLimits, error)
type UserResponse ¶
type UserResponse struct { ID string `json:"id"` Username string `json:"username"` Discriminator string `json:"discriminator"` Avatar string `json:"avatar"` Email string `json:"email"` Verified bool `json:"verified"` }
UserResponse represents the Discord user information
type Wrapper ¶
type Wrapper struct { DiscordService *DiscordService S3Service *S3Service StripeService *StripeService CognitoService service.CognitoService KubeService KubernetesService RabbitMQService *RabbitMqService HearthhubDb *gorm.DB ModNexusService *ModNexusService }