Documentation
¶
Index ¶
- type AuthProvider
- type AuthProviderImpl
- func (a *AuthProviderImpl) GenerateToken(username, role string) (string, error)
- func (a *AuthProviderImpl) HandleLogin(username, password string) (string, error)
- func (a *AuthProviderImpl) NewTokenAuth() *jwtauth.JWTAuth
- func (a *AuthProviderImpl) RefreshToken(token string) (string, error)
- func (a *AuthProviderImpl) ValidateToken(token string) (bool, error)
- func (a *AuthProviderImpl) ValidateUserPassword(username, password string) (role string, valid bool, err error)
- type SessionProvider
- type SessionProviderImpl
- type SessionRequest
- type TektonClient
- type TektonClientImpl
- func (c *TektonClientImpl) GetTaskRun(ctx context.Context, namespace string, id uuid.UUID) (*tektonAPI.TaskRun, error)
- func (c *TektonClientImpl) GetTaskRunLogs(ctx context.Context, taskRun *tektonAPI.TaskRun) (string, error)
- func (c *TektonClientImpl) Logs(ctx context.Context, taskRun *tektonAPI.TaskRun) (string, error)
- func (c *TektonClientImpl) RunTaskRun(ctx context.Context, taskRun *tektonAPI.TaskRun) error
- func (c *TektonClientImpl) WatchTaskRun(ctx context.Context, taskRun *tektonAPI.TaskRun, id uuid.UUID) (<-chan watch.Event, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthProvider ¶ added in v0.3.0
type AuthProvider interface { // HandleLogin is a method that will be implemented by the auth provider HandleLogin(username, password string) (string, error) // ValidateToken is a method that will be implemented by the auth provider ValidateToken(token string) (bool, error) // ValidateUserPassword is a method that will be implemented by the auth provider ValidateUserPassword(username, password string) (role string, valid bool, err error) // RefreshToken is a method that will be implemented by the auth provider RefreshToken(token string) (string, error) // GenerateToken is a method that will be implemented by the auth provider GenerateToken(username, role string) (string, error) // NewTokenAuth is a method that will be implemented by the auth provider NewTokenAuth() *jwtauth.JWTAuth }
func NewAuthProvider ¶ added in v0.3.0
func NewAuthProvider() (AuthProvider, error)
NewAuthProvider creates a new AuthProvider
type AuthProviderImpl ¶ added in v0.3.0
type AuthProviderImpl struct { JWTSecret string JWTAuth *jwtauth.JWTAuth }
AuthProviderImpl is the default implementation of the AuthProvider interface
func (*AuthProviderImpl) GenerateToken ¶ added in v0.3.0
func (a *AuthProviderImpl) GenerateToken(username, role string) (string, error)
GetToken is a method that will be implemented by the auth provider
func (*AuthProviderImpl) HandleLogin ¶ added in v0.3.0
func (a *AuthProviderImpl) HandleLogin(username, password string) (string, error)
HandleLogin is a method that will be implemented by the auth provider
func (*AuthProviderImpl) NewTokenAuth ¶ added in v0.3.0
func (a *AuthProviderImpl) NewTokenAuth() *jwtauth.JWTAuth
NewTokenAuth is a method that will be implemented by the auth provider
func (*AuthProviderImpl) RefreshToken ¶ added in v0.3.0
func (a *AuthProviderImpl) RefreshToken(token string) (string, error)
RefreshToken is a method that will be implemented by the auth provider
func (*AuthProviderImpl) ValidateToken ¶ added in v0.3.0
func (a *AuthProviderImpl) ValidateToken(token string) (bool, error)
ValidateToken is a method that will be implemented by the auth provider
func (*AuthProviderImpl) ValidateUserPassword ¶ added in v0.3.0
func (a *AuthProviderImpl) ValidateUserPassword(username, password string) (role string, valid bool, err error)
ValidateUserPassword is a method that will be implemented by the auth provider
type SessionProvider ¶ added in v0.3.0
type SessionProvider interface { // CreateSession is a method that will be implemented by the session provider CreateSession(request SessionRequest) error // GetSession is a method that will be implemented by the session provider GetSession(id string) (entities.Session, error) // DeleteSession is a method that will be implemented by the session provider DeleteSession(id string) error }
func NewSessionProvider ¶ added in v0.3.0
func NewSessionProvider(repository repositories.SessionsRepository) (SessionProvider, error)
type SessionProviderImpl ¶ added in v0.3.0
type SessionProviderImpl struct {
Repository repositories.SessionsRepository
}
func (*SessionProviderImpl) CreateSession ¶ added in v0.3.0
func (s *SessionProviderImpl) CreateSession(request SessionRequest) error
func (*SessionProviderImpl) DeleteSession ¶ added in v0.3.0
func (s *SessionProviderImpl) DeleteSession(id string) error
func (*SessionProviderImpl) GetSession ¶ added in v0.3.0
func (s *SessionProviderImpl) GetSession(id string) (entities.Session, error)
type SessionRequest ¶ added in v0.3.0
type TektonClient ¶
type TektonClient interface { // GetTaskRun returns a task run by name. GetTaskRun(ctx context.Context, namespace string, id uuid.UUID) (*tektonAPI.TaskRun, error) // RunTask runs a task. RunTaskRun(ctx context.Context, taskRun *tektonAPI.TaskRun) error // WatchTaskRun watches a task run. WatchTaskRun(ctx context.Context, taskRun *tektonAPI.TaskRun, id uuid.UUID) (<-chan watch.Event, error) // GetTaskRunLogs returns a stream of logs for a task run. GetTaskRunLogs(ctx context.Context, taskRun *tektonAPI.TaskRun) (string, error) }
TektonClient is a client for interacting with Tekton.
func NewTektonClient ¶
func NewTektonClient() (TektonClient, error)
NewTektonClient creates a new TektonClient.
type TektonClientImpl ¶
type TektonClientImpl struct {
// contains filtered or unexported fields
}
func (*TektonClientImpl) GetTaskRun ¶
func (c *TektonClientImpl) GetTaskRun(ctx context.Context, namespace string, id uuid.UUID) (*tektonAPI.TaskRun, error)
GetTaskRun returns a task run by ID.