Skip to content

Packages

Reusable portable modules - Generic packages designed to work independently of ION Flow.


The packages/ directory contains reusable, self-contained modules that can be used in any Go project. They are designed with modularity and portability in mind.


  • Self-contained - No dependencies on ION-specific code
  • Independent - Works standalone without ION Flow
  • Portable - Can be imported by other projects
  • Generic - Solves common problems

PackageDescription
ChannelAuthentication engine (OAuth, API Key, Basic)
HelpersGeneric utility functions

Authentication engine supporting multiple auth types:

import "gitlab.com/altacrest/flow_binaries/packages/channel/services"
// Authorize a connection
response, err := services.Authorize(authType, apiConfig, params, state)
// Get token (OAuth)
token, err := services.TokenHandler(config, params)
// Refresh token
newToken, err := services.RefreshHandler(config, params)
// Get connection info
info, err := services.Info(authType, config, params)
TypeDescription
oauth2_codeOAuth 2.0 Authorization Code
oauth2_code_refresh_tokenOAuth 2.0 with token refresh
api_keyAPI Key authentication
basicHTTP Basic authentication
client_credentialsOAuth 2.0 Client Credentials
owner_credentialsOAuth 2.0 Resource Owner Password

Learn more about Channel


Generic utility functions:

import "gitlab.com/altacrest/flow_binaries/packages/helpers"
// Configuration parsing
value := helpers.ParseStringWithDefault(input, "default")
num := helpers.ParseIntWithDefault(input, 0)
flag := helpers.ParseBoolWithDefault(input, false)
// JSONC sanitization
clean := helpers.SanitizeJSONC(jsoncString)
data, err := helpers.ParseJSONC(jsoncString)

Learn more about Helpers


graph TD
Channel --> Helpers
Channel --> CoreModels[Core Models]
Helpers[Helpers - Independent]

  • Implementing OAuth authentication
  • Handling API key or Basic auth
  • Making authenticated HTTP requests
  • Managing connection credentials
  • Parsing configuration values with defaults
  • Working with JSONC (JSON with comments)
  • Need generic string/pointer utilities
  • Functionality is completely generic
  • Code could be used in other projects
  • No ION-specific dependencies needed

// Channel package
import "gitlab.com/altacrest/flow_binaries/packages/channel/services"
import "gitlab.com/altacrest/flow_binaries/packages/channel/models"
// Helpers package
import "gitlab.com/altacrest/flow_binaries/packages/helpers"